Sign in to follow this  
sakray

2d tile game.

Recommended Posts

sakray    100
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.

Share this post


Link to post
Share on other sites
sakray    100
[quote name='Manabreak' timestamp='1330001524' post='4915844']
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. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
[/quote]

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

Share this post


Link to post
Share on other sites
HarriPellikka    141
[quote name='sakray' timestamp='1330004799' post='4915856']
Its a 2D game is that sounds complicated ...
[/quote]

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. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this