- Extend the abstract class
Game
- Implement the 3 methods
onCreate()
, onUpdate()
and onRender()
- Create a new instance of your class and call the
start()
method.
public class MyGame extends Game {
public void onCreate() {
// Called when the application is created.
// You can use this for initialization.
}
public void onUpdate() {
// Called 60 times a second.
// Use this for input.
}
public void onRender(Renderer renderer) {
// Called as many times as possible.
// Use the supplied renderer instance to
// draw to the screen.
}
public static void main(String[] args) {
MyGame game = new MyGame();
game.start("My Game!", 300, 150, 3);
}
}