2d tile game.

Started by
3 comments, last by WillTice 12 years, 1 month ago
Wazzzzzzup everyone =) I'm making my own rpg game . I basically need hints on a really fast way to draw the background in java .... I mean super fast.

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.
Advertisement
I would suggest using Java3D with an ortographic projection. Instead of using sprites, you just apply the textures on simple planes and render them instead. :)

I would suggest using Java3D with an ortographic projection. Instead of using sprites, you just apply the textures on simple planes and render them instead. smile.png


Its a 2D game is that sounds complicated ...

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. :)
How big is your background and window resolution? This seems like an inordinate amount of time for it to be taking to draw a simple background.

This topic is closed to new replies.

Advertisement