2d tile game.,
Members - Reputation: 100
Posted 23 February 2012 - 06:46 AM
Currently I have a array with 1000x1000 tile objects ... in my game the hero is centered and the background moves ... witch basically mean that i have to redraw the background every time the hero moves ... Basically its finished ... but i only draw exactly what is going to be displayed witch means that if only half a tile is inside the panel then i cut out that part before displaying it ....
Well it takes the paintcomponent about ~50 ms to repaint the screen witch is unacceptable ... so how can i do this faster ? ideas? tutorials ? Thanks.
Members - Reputation: 141
Posted 23 February 2012 - 08:03 AM
Its a 2D game is that sounds complicated ...
It's a bit more work when implementing it the first time, but after the initial set-up, it's actually just as easy as using Java's own 2D properties. On the plus side, you get vastly more powerful drawing and you can also make effects you can't do directly with plain Java. For example, you can take advantage of the fact that everything is "actually 3D" and, for example, make some "trap tiles" which flip over when your character steps on them.
The extra time you need implementing Java3D depends on how much you have experience, but for myself, I did similar implementation on Android where I swapped my games graphics from Canvas-based to OpenGL. It took me about six hours to do it, which included some abstraction classes to make all the drawing even easier. I would guess that the transition from Java 2D to Java3D isn't much more different.