Following my "Sprite Preview" project, I've created a simple prototype where game entities (creatures) are moving around the screen.
Creating smooth movement was more difficult than I expected. You want your game to be able to run as fast as possible, but be able to deal with slow downs of any magnitude. So how does one deal with arbitrary fluctuations in game speed? How does your update(int delta)
method behave when the delta is 300,000 milliseconds? I ended up implementing something very similar to this
, except without alpha blending as described in that article (I don't think it makes sense to do that in a game).
I've also learned to deal with synchronizing different types of actions. In this prototype, I implemented a SmoothMove action and a Speak action and worked out a way to synchronize them so that it always takes the same time to speak and move 1 step. This part seems strange in retrospect because the solution seems so simple and obvious once it came to me, but was felt damn near impossible when I was struggling to figure it out.
You can check out my web start demo and source code here
*Edit - This prototype deals with my experience in timing and synchronizing game entities and effects in a well-defined fashion. If you are reading the source, you should disregard designs of behavior objects, organization of tasks and the render queue (amongst other things), I will study and redesign those elements, and document them in a future update.