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 — creating the title screen

This screen will show some graphics of our planes, the game title, and two instructional messages on how to start the game or exit it.

  1. To create the title screen, add a method called CreateTitleScreen to the game class.
    Method CreateTitleScreen:Int ()
    
  2. Set the default layer to layerTitle.
    eng.SetDefaultLayer(layerTitle)
    
  3. Next, create a box object covering the whole canvas. We want it to be white and that is its default color.
    Local box:ftObject = eng.CreateBox(cw,ch,cw/2,ch/2)
    
  4. Now, create a local text object for the game title. Place it in the center of the canvas and at one-fourth of the canvas height.
    Local tx1:ftObject = eng.CreateText(font1,"Air Dogs 1942",cw/2,ch/4,1)
    
  5. Scale the text object up by a factor ...

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