-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview02Map2.lua
More file actions
243 lines (193 loc) ยท 7.14 KB
/
Copy pathview02Map2.lua
File metadata and controls
243 lines (193 loc) ยท 7.14 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
-----------------------------------------------------------------------------------------
--
-- view2.lua
--
-----------------------------------------------------------------------------------------
-- ๊ฒ์ ์ค๋ช
์ฐฝ
local composer = require( "composer" )
local scene = composer.newScene()
local loadsave = require( "loadsave" )
function scene:create( event )
local sceneGroup = self.view
local loadedSettings = loadsave.loadTable( "settings.json" )
local click1 = audio.loadStream( "์์
/ํด๋ฆญ1.wav" )
local background = display.newImageRect("์ด๋ฏธ์ง/๋ง์/๋ฐฐ๊ฒฝ2.png",display.contentWidth, display.contentHeight)
background.x,background.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(background)
-- ํ๋ฉด ์ ํ
local options={
effect="crossFade"
}
-- ๋ง์์ด๋ฏธ์ง
local red = display.newImage("์ด๋ฏธ์ง/๋ง์/๋นจ๊ฐ.png")
red.x,red.y = display.contentWidth*0.223,display.contentHeight*0.297
red.name = "1"
sceneGroup:insert(red)
local blue = display.newImage("์ด๋ฏธ์ง/๋ง์/ํ๋.png")
blue.x,blue.y = display.contentWidth*0.794,display.contentHeight*0.29
blue.name = "2"
sceneGroup:insert(blue)
local yellow = display.newImage("์ด๋ฏธ์ง/๋ง์/๋
ธ๋.png")
yellow.x,yellow.y = display.contentWidth*0.5,display.contentHeight*0.185
yellow.name = "3"
sceneGroup:insert(yellow)
local purple = display.newImage("์ด๋ฏธ์ง/๋ง์/๋ณด๋ผ.png")
purple.x,purple.y = display.contentWidth*0.217,display.contentHeight*0.698
purple.name = "4"
sceneGroup:insert(purple)
local green = display.newImage("์ด๋ฏธ์ง/๋ง์/์ด๋ก.png")
green.x,green.y = display.contentWidth*0.785,display.contentHeight*0.713
green.name = "5"
sceneGroup:insert(green)
local em = display.newImage("์ด๋ฏธ์ง/๋ง์/์์๊ฑฐ์ฒ.png")
em.x,em.y = display.contentWidth*0.5,display.contentHeight*0.829
em.name = "6"
sceneGroup:insert(em)
local store = display.newImage("์ด๋ฏธ์ง/๋ง์/์์ .png")
store.x,store.y = display.contentWidth*0.5,display.contentHeight*0.505
store.name = "7"
sceneGroup:insert(store)
-- ํ๊ฒ ์ปฌ๋ฌ ๊ฐ ๊ฐ์ ธ์ค๊ธฐ
color = composer.getVariable("color")
local function gotomap(event)
if event.phase == "began" then
composer.removeScene("view02Map2")
composer.gotoScene("view02Map")
end
end
-- ๊ฒ์ ์ด๋
local function gotogame(event)
-- ์ด๋ฒคํธ ์กฐ๊ฑด ์ค์
loadedSettings.game_num = loadedSettings.game_num + 1
if loadedSettings.month == 5 then
if loadedSettings.month6_event == 0 then
loadedSettings.month6_event = loadedSettings.month6_event + 1
end
end
loadsave.saveTable(loadedSettings,"settings.json")
if color == "1" then
composer.removeScene("view02Map2")
composer.gotoScene( "view05Dudu",options )
elseif color == "2" then
composer.removeScene("view02Map2")
composer.gotoScene( "view07Number" ,options )
elseif color == "3" then
composer.removeScene("view02Map2")
composer.gotoScene( "view09Lemon" ,options )
elseif color == "4" then
composer.removeScene("view02Map2")
composer.gotoScene( "view18ring",options )
else
composer.removeScene("view02Map2")
composer.gotoScene( "view21card" ,options )
end
end
local function exitt()
exit = display.newImage("์ด๋ฏธ์ง/๊ณตํต/x๋ฒํผ.png")
sceneGroup:insert(exit)
exit.x, exit.y = display.contentWidth*0.948, display.contentHeight*0.09
exit:addEventListener("touch",gotomap)
end
local function exitt2()
exit2 = display.newImage("์ด๋ฏธ์ง/๊ณตํต/x๋ฒํผ.png")
sceneGroup:insert(exit2)
exit2.x, exit2.y = display.contentWidth*0.763, display.contentHeight*0.289
exit2:addEventListener("touch",gotomap)
end
local function start()
start = display.newImage("์ด๋ฏธ์ง/๊ณตํต/start๋ฒํผ.png")
start.x, start.y = display.contentWidth*0.399, display.contentHeight*0.642
sceneGroup:insert(start)
start:addEventListener("touch",gotogame)
end
--์๋ณ ๋ง์ ๋ฐฉ๋ฌธ
--๊ฒ์์ด๋
if loadedSettings.game_num ~= 1 then
if color == "1" then
--๋นจ๊ฐ๊ฒ์ ์ด๋
duduinfo = display.newImage("์ด๋ฏธ์ง/๋ฏธ๋๊ฒ์/๋ง์์ง๋_๊ฒ์์ค๋ช
์ฐฝ/๋ฏธ๋๊ฒ์_๊ฒ์์ค๋ช
(๋นจ๊ฐ๋ง์).png")
duduinfo.x, duduinfo.y = display.contentWidth/2, display.contentHeight/2
sceneGroup:insert(duduinfo)
exitt()
exitt2()
start()
elseif color == "2" then
-- ํ๋๊ฒ์ ์ด๋
local numinfo = display.newImage("์ด๋ฏธ์ง/๋ฏธ๋๊ฒ์/๋ง์์ง๋_๊ฒ์์ค๋ช
์ฐฝ/๋ฏธ๋๊ฒ์_๊ฒ์์ค๋ช
(ํ๋๋ง์).png")
numinfo.x, numinfo.y = display.contentWidth/2, display.contentHeight/2
sceneGroup:insert(numinfo)
exitt()
exitt2()
start()
elseif color == "3" then
-- ๋
ธ๋๊ฒ์ ์ด๋
local lemoninfo = display.newImage("์ด๋ฏธ์ง/๋ฏธ๋๊ฒ์/๋ง์์ง๋_๊ฒ์์ค๋ช
์ฐฝ/๋ฏธ๋๊ฒ์_๊ฒ์์ค๋ช
(๋
ธ๋๋ง์).png")
lemoninfo.x, lemoninfo.y = display.contentWidth/2, display.contentHeight/2
sceneGroup:insert(lemoninfo)
exitt()
exitt2()
start()
elseif color == "4" then
-- ๋ณด๋ผ๊ฒ์ ์ด๋
print("๋ณด๋ผ")
local ringinfo = display.newImage("์ด๋ฏธ์ง/๋ฏธ๋๊ฒ์/๋ง์์ง๋_๊ฒ์์ค๋ช
์ฐฝ/๋ฏธ๋๊ฒ์_๊ฒ์์ค๋ช
(๋ณด๋ผ๋ง์).png")
ringinfo.x, ringinfo.y = display.contentWidth/2, display.contentHeight/2
sceneGroup:insert(ringinfo)
exitt()
exitt2()
start()
elseif color == "5" then
-- ์ด๋ก๊ฒ์ ์ด๋
print("์ด๋ก")
local miniinfo = display.newImage("์ด๋ฏธ์ง/๋ฏธ๋๊ฒ์/๋ง์์ง๋_๊ฒ์์ค๋ช
์ฐฝ/๋ฏธ๋๊ฒ์_๊ฒ์์ค๋ช
(์ด๋ก๋ง์).png")
miniinfo.x, miniinfo.y = display.contentWidth/2, display.contentHeight/2
sceneGroup:insert(miniinfo)
exitt()
exitt2()
start()
end
else
composer.removeScene("view02Map2")
composer.gotoScene( "view15limited" )
end
end
function scene:show( event )
local sceneGroup = self.view
local phase = event.phase
if phase == "will" then
-- Called when the scene is still off screen and is about to move on screen
elseif phase == "did" then
-- Called when the scene is now on screen
--
-- INSERT code here to make the scene come alive
-- e.g. start timers, begin animation, play audio, etc.
end
end
function scene:hide( event )
local sceneGroup = self.view
local phase = event.phase
if event.phase == "will" then
-- Called when the scene is on screen and is about to move off screen
--
-- INSERT code here to pause the scene
-- e.g. stop timers, stop animation, unload sounds, etc.)
elseif phase == "did" then
-- Called when the scene is now off screen
composer.removeScene("view02Map2")
end
end
function scene:destroy( event )
local sceneGroup = self.view
-- Called prior to the removal of scene's "view" (sceneGroup)
--
-- INSERT code here to cleanup the scene
-- e.g. remove display objects, remove touch listeners, save state, etc.
end
---------------------------------------------------------------------------------
-- Listener setup
scene:addEventListener( "create", scene )
scene:addEventListener( "show", scene )
scene:addEventListener( "hide", scene )
scene:addEventListener( "destroy", scene )
-----------------------------------------------------------------------------------------
return scene