1 local storyboard = require (“storyboard”)
2 local scene = storyboard.newScene()
3
4 function scene:createScene(event)
5
6 local screenGroup = self.view
7
8 background = display.newImageRect(“Images/blue.jpg”, display.contentWidth, display.contentHeight)
9 background.y = display.contentCenterY
10 background.x = display.contentCenterX
11 screenGroup:insert(background)
12
13 backgroundSand = display.newImageRect(“Images/bg_sand.jpg”, display.contentWidth,25)
14 backgroundSand.x = display.contentCenterX
15 backgroundSand.y = display.contentHeight-10
16 screenGroup:insert(backgroundSand)
17
18 end
19
20 function start(event)
21 if event.phase == “began” then
22 storyboard.gotoScene(“game”, “fade”, 400)
23 end
23 end
25
26function scene:enterScene(event)
27
28 storyboard.purgeScene(“game”)
29 background:addEventListener(“touch”, start)
30
31 end
32
33 function scene:exitScene(event)
34
35
36 background:removeEventListener(“touch”, start)
37
38 end
39
40 function scene:destroyScene(event)
41
42 end
43
44 scene:addEventListener(“createScene”, scene)
45 scene:addEventListener(“enterScene”, scene)
46 scene:addEventListener(“exitScene”, scene)
47 scene:addEventListener(“destroyScene”, scene)
48
49 return scene