Drawing graphics in Java game

Posted by wolf on Game Development See other posts from Game Development or by wolf
Published on 2012-09-10T23:06:54Z Indexed on 2012/09/11 3:50 UTC
Read the original article Hit count: 386

I am quite new to game development, so here is a question (maybe a stupid one):

In my sidescroller i have a bunch of different graphics objects that i need to draw (player, background tiles, creatures, projectiles etc). Most tutorials i've read so far show that each object has its own draw method, which is then called from some other method.

What if I had one method that does all the drawing? Lets say i keep all my objects in an array or queue (or multiple arrays) and then go through each of them, get an image and draw it.

So basically would it be better (and why) to have each object have its own draw method or one method that does all the drawing? Or does it matter at all? I feel like the second option is more comfortable, because then all the stuff to do with drawing would be in one place...

© Game Development or respective owner

Related posts about java

Related posts about rendering