JAVA Classes in Game programming.

Posted by Gabriel A. Zorrilla on Stack Overflow See other posts from Stack Overflow or by Gabriel A. Zorrilla
Published on 2010-04-12T18:38:10Z Indexed on 2010/04/12 18:42 UTC
Read the original article Hit count: 430

Filed under:
|
|

I'm doing a little strategy game to help me learn Java in a fun way. The thing is I visioned the units as objects that would self draw on the game map (using images and buffering) and would react to the mouse actions with listeners attached to them.

Now, based on some tutorials I've been reading regarding basic game programming, all seems to be drawn in the Graphics method of my Map class. If a new unit emerges, i just update the Map.Graphics method, it's not as easy as making a new Unit object which would self draw... In this case, I'd be stuck with a whole bunch of Map methods instead of using classes for rendering new things.

So my question is, is it possible to use classes for rendering units, interface objects, etc, or i'll have to create methods and just do some kind of structural programming instead of object oriented? I'm a little bit confused and I'd like to have a mental blueprint of how things would be organized.

Thanks!

© Stack Overflow or respective owner

Related posts about java

Related posts about classes