This repository has been archived by the owner on Nov 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Mojo App
nitrologic edited this page Mar 30, 2013
·
9 revisions
If you are building an app in Monkey you can begin by extending the mojo App Class.
For starters, read the monkey manual entry on mojo, if you get to this bit, you are on the right page:
Mojo functions should not be called until your application's OnCreate method is called. This means you cannot initialize global variables with values returned by mojo functions such as MilliSecs - you must instead initialize such variables in your application's OnCreate method or later.
The following app will verify that Monkey is configured to work on the platform you are targetting and that the logging command Print produces visible output:
Import mojo
Class MyApp Extends App
Method OnCreate()
Print Millisecs
End
End
Function Main()
New MyApp
End
The three primary methods of the App class come with caveats:
- Call SetUpdateRate 60 so your game will refresh
- Draw anything
- Update user input
- Draw anything
- Draw to the display
- Do evil