We will now build the basic structure for every game. Follow the given steps:
1. Your first command in Pongo, and in every game, should be the
Strict
command, so that Monkey will keep us on track regarding giving identifiers the right type.Strict
2. Next should be some comments that describe the script somehow.
#rem Script: Pongo.Monkey Description: Sample script from chapter #2 of the book "Monkey Game Development Beginners guide" by PacktPub Author: Michael Hartlef #end
3. Because we want to use the Monkey built-in framework
mojo
, we have to import it.Import mojo
4. Now, we need to create the
pongo
class that extends frommojo's
app class. We will include emptyOnCreate, OnUpdate
, andOnRender
methods that we will fill later on.Class pongo Extends App Method OnCreate:Int() SetUpdateRate(60) Return True End Method OnUpdate:Int() Return True End Method OnRender:Int() Return True End End Function Main:Int() New pongo Return True End
5. The...