You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thomas Cashman edited this page Aug 16, 2013
·
4 revisions
To make it easy to get started with mini2Dx we've added a simplified game class called BasicGame. The following code shows how to extends the BasicGame class for your game.
importorg.mini2Dx.core.game.BasicGame;
importorg.mini2Dx.core.game.Mini2DxGame;
importorg.mini2Dx.core.graphics.Graphics;
publicclassBasicGameExampleextendsBasicGame {
@Overridepublicvoidinitialise() {
//Initialise your objects here
}
@Overridepublicvoidupdate(floatdelta) {
//Game logic here
}
@Overridepublicvoidinterpolate(floatalpha) {
//Calculate render coordinates here
}
@Overridepublicvoidrender(Graphicsg) {
//Rendering here
}
}
To launch your game via a desktop (PC/Mac/Linux) project, simply edit your main method with the following.