-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview99end.lua
More file actions
319 lines (264 loc) Β· 11.5 KB
/
Copy pathview99end.lua
File metadata and controls
319 lines (264 loc) Β· 11.5 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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
--μλ© νλ©΄
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 loadedEndings = loadsave.loadTable( "endings.json" )
local endingMusic = audio.loadStream("μμ
/μλ©.mp3" )
audio.setVolume( loadedEndings.logValue )
audio.play(endingMusic)
--μν λ³Όλ₯¨ μ΄λ―Έμ§
local volumeButton = display.newImage("μ΄λ―Έμ§/νμ΄ν/μ€μ .png")
volumeButton.x,volumeButton.y = display.contentWidth * 0.87, display.contentHeight * 0.9
sceneGroup:insert(volumeButton)
--μνλ³Όλ₯¨ν¨μ--
local function setVolume(event)
composer.showOverlay( "volumeControl", options )
end
volumeButton:addEventListener("tap",setVolume)
local options = {
isModal = true
}
--μ°μ μλ©--
local back = display.newRect(display.contentWidth/2,display.contentHeight/2, display.contentWidth,display.contentHeight)
back:setFillColor(0)
sceneGroup:insert(back)
--무μ§κ° μλ© --
local rainbow = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/무μ§κ°.png")
rainbow.x, rainbow.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(rainbow)
rainbow.alpha = 0
local mix_red = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/μ°μ λΉ¨κ°.png")
mix_red.x, mix_red.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(mix_red)
mix_red.alpha = 0
local mix_yellow = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/μ°μ λ
Έλ.png")
mix_yellow.x, mix_yellow.y =display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(mix_yellow)
mix_yellow.alpha =0
local mix_blue = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/μ°μ νλ.png")
mix_blue.x,mix_blue.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(mix_blue)
mix_blue.alpha = 0
local mix_purple = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/μ°μ 보λΌ.png")
mix_purple.x, mix_purple.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(mix_purple)
mix_purple.alpha = 0
local mix_green = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/μ°μ μ΄λ‘.png")
mix_green.x, mix_green.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(mix_green)
mix_green.alpha = 0
--νΌν©μλ©--
local violet = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/νΌν©(곡λΆ)λ°μ΄μ¬λ .png")
violet.x, violet.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(violet)
violet.alpha = 0
local act_violet = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/νΌν©(νλ)λ°μ΄μ¬λ .png")
act_violet.x, act_violet.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(act_violet)
act_violet.alpha = 0
local orange = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/νΌν©(곡λΆ)μ£Όν©.png")
orange.x, orange.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(orange)
orange.alpha = 0
local act_orange = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/νΌν©(νλ)μ£Όν©.png")
act_orange.x, act_orange.y =display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(act_orange)
act_orange.alpha = 0
local chung = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/νΌν©(곡λΆ)μ²λ‘.png")
chung.x, chung.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(chung)
chung.alpha = 0
local act_chung = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/νΌν©(νλ)μ²λ‘.png")
act_chung.x, act_chung.y =display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(act_chung)
act_chung.alpha = 0
--νλ μλ©
local good = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/κ΅Ώ.png")
good.x, good.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(good)
good.alpha = 0
local bad = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/λ°°λ.png")
bad.x, bad.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(bad)
bad.alpha = 0
local pastell_yellow = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/νμ€ν
λ
Έλ.png")
pastell_yellow.x, pastell_yellow.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(pastell_yellow)
pastell_yellow.alpha = 0
local pastell_purple = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/νμ€ν
보λΌ.png")
pastell_purple.x, pastell_purple.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(pastell_purple)
pastell_purple.alpha = 0
local pastell_red = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/νμ€ν
λΉ¨κ°.png")
pastell_red.x, pastell_red.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(pastell_red)
pastell_red.alpha = 0
local pastell_blue = display.newImage("μ΄λ―Έμ§/μλ©/μλ©μΉ΄λ/νμ€ν
νλ.png")
pastell_blue.x, pastell_blue.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(pastell_blue)
pastell_blue.alpha =0
-- μ¬ν λͺ¨μλμλ μ€ν―
-- μ€ν―μ κ°μ λ°λΌ μλ© νλ©΄ λ°λ
study = loadedSettings.study
fun = loadedSettings.fun
hobby = loadedSettings.hobby
friendship = loadedSettings.friendship
red = loadedSettings.red
yellow = loadedSettings.yellow
green = loadedSettings.green
purple = loadedSettings.purple
blue = loadedSettings.blue
-- νμ€ν
μλ©
local function pastel()
if (red >= yellow) and (red >= green) and (red >= blue) and (red >= purple) then
transition.to(pastell_red,{time=2000,alpha=1})
loadedEndings.pastel_red = 1
elseif (yellow >= red) and (yellow >= green) and (yellow >= blue) and (yellow >= purple) then
transition.to(pastell_yellow,{time=2000,alpha=1})
loadedEndings.pastel_yellow = 1
elseif (green >= red) and (green >= yellow) and (green >= blue) and (green >= purple) then
transition.to(pastell_green,{time=2000,alpha=1})
loadedEndings.pastel_green = 1
elseif (blue >= red) and (blue >= yellow) and (blue >= green) and (blue >= purple) then
transition.to(pastell_blue,{time=2000,alpha=1})
loadedEndings.pastel_blue= 1
elseif (purple >= red) and (purple >= yellow) and (purple >= green) and (purple >= blue) then
transition.to(pastell_purple,{time=2000,alpha=1})
loadedEndings.pastel_purple = 1
end
end
--νλ/곡λΆ/μ·¨λ―Έ μλ© (νΌν©)
if (study >= 80) and (hobby >= 80) and (fun >= 80) and (friendship >= 80) then
transition.to(rainbow,{time=2000,alpha=1})
loadedEndings.rainbow = 1
elseif (study >= fun) and (study >= hobby) and (study >= friendship) and (study >= 70) then
if (red >= 50) and (yellow >= 50) then
transition.to(orange,{time=2000,alpha=1})
loadedEndings.orange=1
elseif (blue >= 50) and (green >= 50) then
transition.to(chung,{time=2000,alpha=1})
loadedEndings.chung=1
elseif (red >= 50) and (blue >=50) and (purple>=60) then
transition.to(violet,{time=2000,alpha=1})
loadedEndings.violet=1
else
pastel()
end
elseif ((hobby >= study) and (hobby >= friendship) and (fun >= 70)) or ((fun >= study) and (fun >= friendship) and (fun >= 70)) then
if (red >= 50) and (yellow >= 50) then
transition.to(act_orange,{time=2000,alpha=1})
loadedEndings.act_orange=1
elseif (blue >= 50) and (green >= 50) then
transition.to(act_chung,{time=2000,alpha=1})
loadedEndings.act_chung=1
elseif (red >= 50) and (blue >=50) and (purple>=50) then
transition.to(act_violet,{time=2000,alpha=1})
loadedEndings.act_violet=1
else
pastel()
end
--μ°μ μλ©
elseif (friendship >= study) and (friendship >= fun) and (friendship >= hobby) and (friendship >= 70) then
if (red >= yellow) and (red >= green) and (red >= blue) and (red >= purple) and (red >= 50) then
transition.to(mix_red,{time=2000,alpha=1})
loadedEndings.red =1
elseif (yellow >= red) and (yellow >= green) and (yellow >= blue) and (yellow >= purple) and (yellow >=50) then
transition.to(mix_yellow,{time=2000,alpha=1})
loadedEndings.yellow=1
elseif (green >= red) and (green >= yellow) and (green >= blue) and (green >= purple) and (green >= 50) then
transition.to(mix_green,{time=2000,alpha=1})
loadedEndings.green =1
elseif (blue >= red) and (blue >= yellow) and (blue >= green) and (blue >= purple) and (blue >=50) then
transition.to(mix_blue,{time=2000,alpha=1})
loadedEndings.blue=1
elseif (purple >= red) and (purple >= yellow) and (purple >= green) and (purple >= blue) and (purple >= 50) then
transition.to(mix_purple,{time=2000,alpha=1})
loadedEndings.purple =1
else
pastel()
end
--νΈκ°λ 40 μ΄ν
elseif (friendship <= 40) and (fun <= 40) and (hobby <= 40 ) and (study <= 40) and (red <= 40) and (yellow <= 40) and (green <= 40) and (blue <= 40) and (purple <= 40) then
--ν λ‘μ μ΄λ²€νΈμ λ°λΌ κ΅Ώ/λ°°λ λλ¨
if loadedSettings.goodWhite == 1 then
loadedEndings.good = 1
transition.to(good,{time=2000,alpha=1})
elseif loadedSettings.badWhite == 1 then
loadedEndings.bad = 1
transition.to(bad,{time=2000,alpha=1})
else
loadedEndings.bad = 1
transition.to(bad,{time=2000,alpha=1})
end
--νμ€ν
μλ©
else
pastel()
end
local function goback(event)
if event.phase == "began" then
composer.removeScene("view99end")
audio.pause(home)
local titleMusic = audio.loadStream( "μμ
/νμ΄ν.mp3" )
audio.play(titleMusic)
composer.gotoScene("title")
end
end
-- νλ©΄μ΄ μ μ°¨ λ°μμ§
local title = display.newImage("μ΄λ―Έμ§/μλ©/νμ΄νλ‘.png")
title.x,title.y = display.contentWidth*0.0180,display.contentHeight*0.0277
sceneGroup:insert(title)
title.alpha = 0
title.anchorX, title.anchorY = 0,0
title:addEventListener("touch",goback)
transition.to(title,{time=2000,alpha=1,delay=3000})
-- λͺ¨λ μλ© λ΄€μ λ bonus μλ© νμΈ κ°λ₯
if (best == 1) and (friend1 == 1) and (friend2==2) and (friend3==1) and (friend4==1) and (friend5 == 1) and (mix1 == 1) and (mix2 == 1) and (mix3 == 1) and (mix4 == 1) and (mix5 == 1) and (mix6 == 1) and (pastel1==1) and (pastel2 == 1) and (pastel3==1) and (pastel4 == 1) and (pastel5 == 1) and (hidden1==1) and (hidden2 == 1) then
loadedEndings.bonus = 1
end
if loadedEndings.end_num == 0 then
loadedEndings.end_num=loadedEndings.end_num+1
end
loadsave.saveTable(loadedEndings,"endings.json")
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("viewmonth5_event")
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