Cover by Michelle M. Fernandez

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Time for action – adding an options menu

We'll be adding an options menu that can be accessed through the main menu. We're going to add a new UI button called Credits, which will direct the user to the credits screen once it is pressed.

  1. Create a new file called options.lua and import Storyboard and UI modules, thestoryboard.newScene() function, and the variables for timer and audio.
    local storyboard = require( "storyboard" )
    local scene = storyboard.newScene()
    
    local ui = require("ui")
    
    local btnAnim
    
    local btnSound = audio.loadSound( "btnSound.wav" )
  2. Create the createScene() event. Add in, storyboard.removeScene( "mainmenu" ), which will remove the "mainmenu" scene. This will occur after the player has transitioned from the main menu screen and is ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required