permaculture playing cards*
The moose likes Game Development and the fly likes Building a better animation infrastructure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "Building a better animation infrastructure" Watch "Building a better animation infrastructure" New topic
Author

Building a better animation infrastructure

Kevin Corina
Greenhorn

Joined: Nov 29, 2012
Posts: 14
So I'm working on a really basic "game" just to really test out sprite animation and make a decent, reusable infrastructure.
So basically in GraphicsShell I set up a loopGame that double buffers and renders, and renders then updates.
I set it up to to loop every 30 seconds, in which it calls the draw methods of my background class and player class.
in player, I use to a subclass to load multiple frames into an arrays.

Some animations I would like to be "forced" as the frames cant change until the array finished the animation, (for example, and attack animation would be executed one, and not repeated) while other animations could be changed mid array loop such (such as changing from a left facing run animation to a down facing animation)

GraphicsShell



Player




heres an image.


I feel that my current animation method are inefficient, in your opinion, whats the best way to handle these things?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Building a better animation infrastructure