O'Reilly logo

Monkey Game Development by Michael Hartlef

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — building the basic file structure of the game

Let's begin with the basic game structure:

  1. Open an empty script and save it under the file name RocketCommander.monkey, in a folder of your choice.
  2. The first line in this new script will tell Monkey to compile your script in STRICT mode.
    Strict
    
  3. Now, add some comments about the script.
    #rem
    Script: RocketCommander.monkey
    Description: Sample script from chapter #3 of the book
    "Monkey Game Development Beginners guide" by PacktPub
    Author: Michael Hartlef
    #end
    
  4. This time we won't import mojo, but another file, in which we'll import all the classes and other files. This file will be created soon, under the name gameClasses.monkey.
    Import gameClasses
    
  5. And finally in this file, we need the main ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required