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.
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" )
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 sent to the options screen. Next, add instoryboard.removeScene( "creditsScreen" )
. This will remove the"creditsScreen"
after the player has transitioned from the credits screen back to the options screen.-- Called when the scene's view does not...