-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview01Map.lua
More file actions
229 lines (178 loc) ยท 6.91 KB
/
Copy pathview01Map.lua
File metadata and controls
229 lines (178 loc) ยท 6.91 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
--๋ง์ ๋งต
local composer = require( "composer" )
local scene = composer.newScene()
local loadsave = require( "loadsave" )
function scene:create( event )
local sceneGroup = self.view
local background = display.newImageRect("์ด๋ฏธ์ง/๋ง์/๋ฐฐ๊ฒฝ2.png",display.contentWidth, display.contentHeight)
background.x,background.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(background)
local loadedSettings = loadsave.loadTable( "settings.json" )
local loadedEndings = loadsave.loadTable( "endings.json" )
-- ์ด๋ฒคํธ ๋ฐ์ ์กฐ๊ฑด ์ค์ .
if loadedSettings.month == 0 then
if loadedSettings.month1_event ==1 then
loadedSettings.month1_event = loadedSettings.month1_event + 1
loadsave.saveTable(loadedSettings,"settings.json")
composer.removeScene("view01Map")
composer.gotoScene("viewmonth1_event")
end
end
if loadedSettings.month == 5 then
if loadedSettings.month6_event == 1 then
loadedSettings.month6_event = loadedSettings.month6_event + 1
loadsave.saveTable(loadedSettings,"settings.json")
composer.removeScene("view01Map")
composer.gotoScene("viewmonth6_event")
end
end
-- ๋ง์ ๋งต ๋ง์ ๊ฐ์ฒด ์์ฑ.
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.437,display.contentHeight*0.505
store.name = "7"
sceneGroup:insert(store)
local store2 = display.newImage("์ด๋ฏธ์ง/๋ง์/๊พธ๋ฏธ๊ธฐ์ต.png")
store2.x,store2.y = display.contentWidth*0.588,display.contentHeight*0.532
store2.name = "8"
sceneGroup:insert(store2)
local click1 = audio.loadStream( "์์
/์ค์นจ.wav" )
-- ๋ง์ ๊ฐ์ฒด ์ปค์ ๋ฒ์ ์ค์ . ๋ฒ์ ๋ฐ์ผ๋ก ๋๊ฐ๋ฉด ๋ง์ ํฌ๊ธฐ ์์์ง๊ณ ์์ผ๋ก ๋ค์ด๊ฐ๋ฉด ๋ง์ ํฌ๊ธฐ ์ปค์ง.
local i = 0
local function bigbig (event)
if (event.target.x-event.x)^2 + (event.target.y-event.y)^2 < 110^2 then
-- i๊ฐ์ ์ง์ ํด ๋๋ ์ด์ ๋ ๋ฒ์ ์์์๋ ํฌ๊ธฐ๊ฐ ๋ ๋์ด๋๊ฑฐ๋ ์ค์ด๋ค์ง ์๊ณ , ์๋ฆฌ๊ฐ ์ฐ์ด์ด ๋์ค์ง ์์.
if i == 0 then
local backgroundMusicChannel = audio.play(click1)
event.target.width = event.target.width*1.1
event.target.height = event.target.height*1.1
i = i + 1
end
elseif (event.target.x-event.x)^2 + (event.target.y-event.y)^2 > 110^2 then
if i == 1 then
event.target.width =event.target.width/11*10
event.target.height =event.target.height/11*10
i = i - 1
end
end
end
local color = 0
-- ๋ฆฌ์ค๋ ํจ์ ์์ฑ
local function touch_ui (event)
if event.phase == "began" then
color = event.target.name
if color == "6" then
local click01 = audio.play(click1)
local home = audio.loadStream( "์์
/์ง.mp3" )
audio.setVolume( loadedEndings.logValue )
audio.play(home)
loadedEndings.bgMusic = "์์
/์ง.mp3"
loadsave.saveTable(loadedEndings,"endings.json")
composer.removeScene("view01Map")
composer.gotoScene( "view00Room" )
elseif color == "7" then
local click01 = audio.play(click1)
local storeMusic = audio.loadStream( "์์
/์์ .mp3" )
audio.setVolume( loadedEndings.logValue )
audio.play(storeMusic);
loadedEndings.bgMusic = "์์
/์์ .mp3"
loadsave.saveTable(loadedEndings,"endings.json")
composer.removeScene("view1Map")
composer.gotoScene( "view04Store" )
elseif color == "8" then
local click01 = audio.play(click1)
local storeMusic = audio.loadStream( "์์
/์์ .mp3" )
audio.setVolume( loadedEndings.logValue )
audio.play(storeMusic);
loadedEndings.bgMusic = "์์
/์์ .mp3"
loadsave.saveTable(loadedEndings,"endings.json")
composer.removeScene("view1Map")
composer.gotoScene( "view04Deco" )
else
local click01 = audio.play(click1)
composer.setVariable("color", color)
composer.removeScene("view1Map")
composer.gotoScene("view02Map")
end
end
end
-- ๋ฆฌ์ค๋ ์ถ๊ฐ
red:addEventListener("mouse",bigbig)
blue:addEventListener("mouse",bigbig)
yellow:addEventListener("mouse",bigbig)
purple:addEventListener("mouse",bigbig)
green:addEventListener("mouse",bigbig)
em:addEventListener("mouse",bigbig)
store:addEventListener("mouse",bigbig)
store2:addEventListener("mouse",bigbig)
red:addEventListener("touch",touch_ui)
blue:addEventListener("touch",touch_ui)
yellow:addEventListener("touch",touch_ui)
purple:addEventListener("touch",touch_ui)
green:addEventListener("touch",touch_ui)
store:addEventListener("touch",touch_ui)
em:addEventListener("touch",touch_ui)
store2:addEventListener("touch",touch_ui)
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
composer.removeScene("view01Map")
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