forked from walterevansaugusta/AndroidLiteracyApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoin.lua
More file actions
55 lines (37 loc) · 1.71 KB
/
coin.lua
File metadata and controls
55 lines (37 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
local composer = require("composer")
local scene = composer.newScene()
local function goToLogin()
composer.gotoScene("login")
end
local function goToMenu()
composer.gotoScene("menu")
end
local function goToZoo()
composer.gotoScene("zoo")
end
function scene:create( event )
local sceneGroup = self.view
local curScene = display.newGroup()
local background = display.newRect(curScene, display.contentCenterX, display.contentCenterY, display.actualContentWidth, display.actualContentHeight)
background.fill = {110/255, 199/255, 212/255}
local secondBackground = display.newRect(curScene, display.contentCenterX + 30, display.contentCenterY, display.actualContentWidth - 60, display.actualContentHeight)
secondBackground.fill = {213/255, 236/255, 237/255}
local backButton = display.newImage(curScene, "images/back.png", display.screenOriginX + 30, curScene.y + 30)
local homeButton = display.newImage(curScene, "images/home.png", display.screenOriginX + 30, curScene.y + 90)
local zooButton = display.newImage(curScene, "images/zoo.png", display.screenOriginX + 30, curScene.y + 290)
zooButton:scale(0.90, 0.90)
backButton:addEventListener("tap", goToMenu)
homeButton:addEventListener("tap", goToLogin)
zooButton:addEventListener("tap", goToZoo)
for i = 0, 5, 1 do
local goldCoin = display.newImage(curScene, "images/coin_gold.png", curScene.x + 230, curScene.y + 200 - i * 20)
goldCoin:scale(0.1, 0.1)
local silverCoin = display.newImage(curScene, "images/coin_silver.png", curScene.x + 300, curScene.y + 200 - i * 20)
silverCoin:scale(0.1, 0.1)
silverCoin.width = goldCoin.width
silverCoin.height = goldCoin.height
end
sceneGroup:insert(curScene)
end
scene:addEventListener("create", scene)
return scene