Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- display.setStatusBar(display.HiddenStatusBar)
- local storyboard = require "storyboard"
- local scene = storyboard.newScene()
- local audioBackground, audioChange
- ----------------------------
- -- Functions
- ----------------------------
- local function gotoMenu()
- if options.audio then
- audio.play(audioChange)
- end
- storyboard.gotoScene("menuScene", "fade", 500)
- end
- ----------------------------
- -- Storyboard
- ----------------------------
- local loopMusic = {fadein = 1000, loops = -1}
- function scene:createScene(event)
- local group = self.view
- if options.audio then
- audioBackground = audio.loadStream("audio/title_background" .. storyboard.audioType)
- audio.play(audioBackground, loopMusic)
- audioChange = audio.loadSound("audio/title_change" .. storyboard.audioType)
- end
- local background = display.newImage(group, "visuals/title_background.png", 0, 0)
- Runtime:addEventListener("touch", gotoMenu)
- end
- function scene:exitScene(event)
- if options.audio then
- audio.stop()
- audio.dispose(audioBackground)
- audio.dispose(audioChange)
- end
- Runtime:removeEventListener("touch", gotoMenu)
- storyboard.purgeScene("titleScene")
- end
- scene:addEventListener("createScene", scene)
- scene:addEventListener("exitScene", scene)
- return scene
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement