Thursday, 17 September 2009

First release!

Today I am releasing the source code to the first version of Rokon game engine for Android.

It is far from finished, but with some work I have no doubts it will be useful to many.

So far, it includes
  • Textures
  • Sprites
  • TTF Fonts and Text
  • Input Handling
  • Animation
  • Dynamics
  • Collision Detection
  • Accelerometer Handling
  • Vibration
  • Audio
The code also includes examples, showing how to use all the important features in the engine.

Get yourself a copy of the code here

Please let me know what you think, and send in your suggestions or bug reports.


  1. I'm looking at the code for GravitySpriteModifier--

    I don't think you want to be calling System.getCurrentTimeMillis() in each modifier for each sprite in your game. Each frame in the game should represent a single moment in time, and be specified centrally. Maybe your call to update the Sprite should also have a CurrentFrame argument, which would represent the common game state as of that frame.

    Also, I'd expect the velocity to be a property of the Sprite and not a property of the SpriteModifier.

  2. That's a good point about the System.getCurrentTimeMillis() call's, it would make sense to do that differently your right.

    About the velocity issue, the Gravity SpriteModifier was made before velocities were introduced to the Sprite class. I should get this changed, thanks for pointing it out!

  3. It does look like there are a lot of System.currentTimeMillis() calls that could be avoided by passing the time delta to various methods, like Sprite#updateMovement and whatnot.

    Actually, while we're on the topic, I think android.os.SystemClock.uptimeMillis() is preferred for stuff like this. Apparently System.currentTimeMillis() can jump around due to the network/user setting the time and whatnot.

  4. Thanks for that Lance, had no idea the SystemClock would be preferred. Heck, I've only been coding for Android a couple of weeks ;)

    I'll get on to wiping out all those nasty currentTimeMillis() tomorrow!