Inside the OnCreate
method of a monkey app, you basically set up the game. For example, loading some graphics can be done here:
1. First set the update rate of the game to
60
frames per second.Method OnCreate:Int() SetUpdateRate(60)
2. Now, create an instance of the
engine
class.eng = New engine
We want to work with a virtual resolution and let the fantomEngine take care of the scaling of our graphics and touch events.
3. Set the virtual canvas size to 480 x 800 with a call to the
SetCanvasSize
method.eng.SetCanvasSize(480,800)
4. Load the texture atlas of the atom elements.
atlas = LoadImage("CR_Tiles.png")
5. Set the
font1
object with our bitmap font.font1 = eng.LoadFont("cr_font") Return 0 End