Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am approaching OpenGL and general gaming-development. I want to start by coding a simple 2D game in Java (lwjgl) but, since I can create models with Blender, I don't want to use 2D sprites, but a semi-flat environment. My target is to remake a classic game but with some cool stuff like particle emitters, bump mapping, lighting and so on... The basic idea is to make something that looks like Super Mario Bros Wii (or Kirby's Adventures Wii, or Super Smash Bros. etc...).

Do you think I have to use JavaMonkeyEngine? Some hints,code snippets, tutorials, links? Do I have to handle a "z-fixed" camera or set-up OpenGL to render in 2D mode? What about the HUD? Sorry if my question is too generic, but I would like to have a clear idea of what I have to do before starting writing code. As always, thanks for your help!

share|improve this question
    
Yeah, this is broad enough that it's multiple questions. To make the gameplay 2D, keep everything (in 3D) at Z = 0. Draw the HUD as a 2D overlay. And, how much do you need to know about general game development? –  chaosTechnician May 9 '12 at 14:06
    
I have read a lot, but now I need to dive into real development. For now I think I'll start from scratch and try to implement something. I'll post some other questions as soon as I get stuck (yes, I will surely get stuck! :P ) What do you think about JavaMonkeyEngine? –  Otacon May 9 '12 at 15:33
2  
If this is your first attempt at developing a game, I'd go with something less ambitious; that's a big pill you're trying to swallow. I've never used JavaMonkeyEngine so I can't offer any insight at all, there. –  chaosTechnician May 9 '12 at 16:07
    
as chaosTechnician said, what you want seems to be 2D gameplay, while actually rendering in 3D. To get "2D" visuals, you would use an orthographic projection matrix, instead of perspective projection. –  melak47 May 9 '12 at 17:15
add comment

2 Answers 2

I'll mostly compile what others said in comments. It's definitely possible to make a 2D game using 3D rendering, it's actually what most games do nowadays. So, to answer your questions:

Do you think I have to use JavaMonkeyEngine?

You can use jMonkeyEngine, but you could use any 3D engine for that matter

Do I have to handle a "z-fixed" camera or set-up OpenGL to render in 2D mode?

I'd say you've got 3 options:

  • Old-school 2D: render only flat polygons at depth zero, with an orthographic projection; that's basically a sprite engine over a 3D engine. You said you didn't want sprites, so I guess this is a no-go.
  • 2.5D: use a "regular" perspective projection but flat polygons only, at different depths layers; that's what's used in Shank or Rayman Origins for instance.
  • 3D with 2D gameplay: full 3D assets, but the gameplay sticks to one plane only, e.g. Trine or Donkey Kong Country Returns.

Some hints, code snippets, tutorials, links?

It all depends on which option you choose, I'm sure you'll find resources by yourself. Still, have a look at Wikipedia for an explanation of orthographic projections, and here for their configuration in jMonkeyEngine.

What about the HUD?

It's just the same as in a 3D game, rendered in screen-space after all the rest with your favorite lib.

share|improve this answer
add comment

Complementing lorancou's answer, I would add that you also have the option to create the backgrounds and objects in 3d, pre-render them and use the pre-rendered sprites in the game. It is possible to obtain nice visuals doing that.
To create a nice sense of depth, use parallax scrolling, you can find information about the technique here:
Question About An Implementation Of Parallax Scrolling In C++/SDL/OpenGL
and here:
http://shinylittlething.com/2009/08/08/pygame-parallax-scrolling-in-2d-games/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.