Connexion utilisateur

Rokon - 2D OpenGL Game Framework

I've been working on a 2D OpenGL framework for a little while now, with full intentions from the start of being open source. Today I am releasing the first (0.1 alpha) version.

There are bugs, and it isn't as fast as it could be. But it's only the start.

Included are 9 examples, each of which explains how to use different features in the framework.

Currently, the framework supports

  • Texture and Sprite management
  • Text, using TTF fonts
  • Organised layers
  • Two audio management classes, one optimized for music, the other for sound effects
  • Sprite dynamics (acceleration, terminal velocity, collisions)
  • Animation
  • Handlers to manage events fired through movement, animation, screen touches, accelerometer input, device shaking and collisions
  • Several minor features aimed at speeding development, such as screen settings and vibration

The framework is intended to make game development as quick and easy as possible, while still keeping the high frame rates that OpenGL can provide.

I have a google code project for this at and a development blog at

There are many things I have listed which I fully intend to implement, such as more complex physics, tile engines and post processing.

Please let me know of bugs, offer suggestions or improvements. I do not purport to be an OpenGL expert. Infact, until last week, I had never touched any sort of OpenGL in my life.

To show how easy it is to implement, I've pasted one of the examples below. It shows a button and 3 sprites. When the button is pressed, the sprites move at different speeds, one rotation.

public class Example4 extends Activity {
Sprite crabSprite1;
Sprite crabSprite2;
Sprite crabSprite3;
Texture crabTexture;
Sprite buttonSprite;
Texture buttonTexture;
Rokon rokon;
Hotspot hotspot;
public void onCreate(Bundle savedInstanceState) {
rokon = Rokon.createEngine(this);
crabTexture = rokon.createTextureFromResource(R.drawable.crab);
buttonTexture = rokon.createTextureFromResource(R.drawable.button);
buttonSprite = new Sprite(5, 5, 100, 50, buttonTexture);
crabSprite1 = new Sprite(10, 50, 80, 80, crabTexture);
crabSprite2 = new Sprite(10, 150, 80, 80, crabTexture);
crabSprite3 = new Sprite(10, 250, 80, 80, crabTexture);
rokon.setInputHandler(new myInputHandler());
hotspot = new Hotspot(buttonSprite);
public class myInputHandler extends InputHandler {
public void onHotspotTouched(Hotspot hotspot) {
crabSprite1.setXY(10, 50);
crabSprite2.setXY(10, 150);
crabSprite3.setXY(10, 250);
crabSprite1.accelerate(25, 0);
crabSprite2.accelerate(50, 0, 100, 0);
crabSprite3.setVelocity(50, 0);
crabSprite3.addModifier(new Spin(1));

You can find the first release, 0.1 alpha at