Jump to content

  • Log In with Google      Sign In   
  • Create Account


2d tile game.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 sakray   Members   -  Reputation: 100

Like
0Likes
Like

Posted 23 February 2012 - 06:46 AM

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.

Sponsor:

#2 Manabreak   Members   -  Reputation: 141

Like
0Likes
Like

Posted 23 February 2012 - 06:52 AM

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

#3 sakray   Members   -  Reputation: 100

Like
0Likes
Like

Posted 23 February 2012 - 07:46 AM

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. Posted Image


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

#4 Manabreak   Members   -  Reputation: 141

Like
0Likes
Like

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

#5 willpowered   Members   -  Reputation: 479

Like
0Likes
Like

Posted 24 February 2012 - 10:28 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS