-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlikeability.lua
More file actions
334 lines (293 loc) ยท 10.3 KB
/
Copy pathlikeability.lua
File metadata and controls
334 lines (293 loc) ยท 10.3 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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
--Likeability 2/4/6์์ ๋ฐ์
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 find1 = composer.getVariable("find1")
local find2= composer.getVariable("find2")
local find3 = composer.getVariable("find3")
local find4 = composer.getVariable("find4")
local find5 = composer.getVariable("find5")
local background = display.newImageRect("์ด๋ฏธ์ง/ํ/๋ฐฐ๊ฒฝ/๊ฐ๊ตฌ์๋๋ฐฐ๊ฒฝ.png",display.contentWidth, display.contentHeight)
background.x,background.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(background)
local paint = { 0,0,0 }
local rect = display.newRect( display.contentWidth*0.5, display.contentHeight*0.5, display.contentWidth, display.contentHeight )
rect.fill = paint
sceneGroup:insert(rect)
rect.alpha = 0
local my_daesapan = display.newImage("์ด๋ฏธ์ง/๋ํ/๋ํ์ฐฝ/์ฃผ์ธ๊ณต.png")
my_daesapan.x, my_daesapan.y = display.contentWidth*0.5,display.contentHeight*0.851
sceneGroup:insert(my_daesapan)
my_daesapan.alpha=1
local letter1 = display.newImage("์ด๋ฏธ์ง/ํธ๊ฐ๋/ํธ์ง ๋์ฐฉ.png")
letter1.x, letter1.y = display.contentWidth*0.505, display.contentHeight*0.5
--letter1.width = 310
--letter1.height = 310
sceneGroup:insert(letter1)
letter1.alpha=1
local letter2 = display.newImage("์ด๋ฏธ์ง/ํธ๊ฐ๋/ํธ์ง ํ์ธ.png")
letter2.x, letter2.y = display.contentWidth*0.431, display.contentHeight*0.561
sceneGroup:insert(letter2)
letter2.alpha=0
local bt = display.newImage("์ด๋ฏธ์ง/๊ณตํต/x๋ฒํผ.png")
bt.x, bt.y = display.contentWidth*0.858,display.contentHeight*0.137
sceneGroup:insert(bt)
bt.alpha=0
local text = display.newText("์ด๋ผ? ๋ฌธ ์์ ํธ์ง๊ฐ ์์๋ค??", 105,550, "font/NanumSquareRoundR.ttf", 30)
sceneGroup:insert(text)
text:setFillColor(alpha)
text.anchorX,text.anchorY = 0,0
text.x, text.y = display.contentWidth * 0.084,display.contentHeight*0.8
mainName = loadedSettings.name
local text2 = display.newText(mainName, 190,505, "font/์ํ๋ฆฌ๋์ค๋ Medium.ttf")
sceneGroup:insert(text2)
text2.size = 45
--text:setFillColor(alpha)
text2.x, text2.y = display.contentWidth * 0.17,display.contentHeight*0.75
local month = display.newText("",888,115,"font/์ํ๋ฆฌ๋์ค๋ Medium.ttf",40)
month:setFillColor(0)
month.size = 25
month.x, month.y = display.contentWidth*0.69, display.contentHeight*0.162
sceneGroup:insert(month)
-- ์ด์ ๋ฌ ํ ์ผ 1
local former = display.newText("",793,175,"font/NanumSquareRoundB.ttf",20)
former.anchorX = 0
former:setFillColor(0.8, 0.2, 0.1)
former.size = 15
former.x, former.y = display.contentWidth*0.622, display.contentHeight*0.244
former.text = loadedSettings.former1
sceneGroup:insert(former)
-- ์ด์ ๋ฌ ํ ์ผ 2
local former2 = display.newText("",793,197,"font/NanumSquareRoundB.ttf",20)
former2.anchorX = 0
former2:setFillColor(0.8, 0.2, 0.1)
former2.size = 15
former2.x, former2.y=display.contentWidth*0.622, display.contentHeight*268
former2.text = loadedSettings.former2
sceneGroup:insert(former2)
-- ๋ค์ ๋ฌ ํ ์ผ 1
local next1 = display.newText("dd",793,254,"font/NanumSquareRoundB.ttf",20)
next1.anchorX = 0
next1:setFillColor(0)
next1.size = 15
next1.x, next1.y =display.contentWidth*0.622, display.contentHeight*0.352
next1.text = loadedSettings.next1
sceneGroup:insert(next1)
-- ๋ค์ ๋ฌ ํ ์ผ 2
local next2 = display.newText("dd",793,276,"font/NanumSquareRoundB.ttf",20)
next2.anchorX = 0
next2:setFillColor(0)
next2.size = 15
next2.x, next2.y = display.contentWidth*0.622, display.contentHeight*0.375
next2.text = loadedSettings.next2
sceneGroup:insert(next2)
--3์ผ๋ก ์์๋ก ๋๋.
local red = loadedSettings.red / 5
local yellow = loadedSettings.yellow / 5
local blue = loadedSettings.blue / 5
local green = loadedSettings.green / 5
local purple = loadedSettings.purple /5
if red > 5 then
red = 5
elseif yellow > 5 then
yellow=5
elseif blue> 5 then
blue =5
elseif green > 5 then
green =5
elseif purple > 5 then
purple = 5
end
local hrt1 = {}
local hrt2 = {}
local hrt3 = {}
local hrt4 = {}
local hrt5 = {}
print(red.. "red"..green.."green" .. yellow .."yellow"..blue.."blue"..purple.."purple")
for i = 1,red do
hrt1[i] = display.newImage("์ด๋ฏธ์ง/ํธ๊ฐ๋/ํธ๊ฐ๋ ํํธ.png")
hrt1[i].x, hrt1[i].y = display.contentWidth*(0.269 + ((i-1) * 0.025)), display.contentHeight*0.519
hrt1[i].alpha = 0
print(red.. "red" .. i)
sceneGroup:insert(hrt1[i])
end
for i = 1, green do
hrt2[i] = display.newImage("์ด๋ฏธ์ง/ํธ๊ฐ๋/ํธ๊ฐ๋ ํํธ.png")
hrt2[i].x, hrt2[i].y = display.contentWidth*(0.448 + ((i-1) * 0.025)), display.contentHeight*0.519
hrt2[i].alpha = 0
sceneGroup:insert(hrt2[i])
print(green.."green" .. i)
end
for i = 1, yellow do
hrt3[i] = display.newImage("์ด๋ฏธ์ง/ํธ๊ฐ๋/ํธ๊ฐ๋ ํํธ.png")
hrt3[i].x, hrt3[i].y = display.contentWidth*(0.627 + ((i-1) * 0.025)), display.contentHeight*0.519
hrt3[i].alpha = 0
print(yellow.."yellow" .. i)
sceneGroup:insert(hrt3[i])
end
for i = 1, blue do
hrt4[i] = display.newImage("์ด๋ฏธ์ง/ํธ๊ฐ๋/ํธ๊ฐ๋ ํํธ.png")
hrt4[i].x, hrt4[i].y = display.contentWidth*(0.359 + ((i-1) * 0.025)), display.contentHeight*0.792
hrt4[i].alpha = 0
sceneGroup:insert(hrt4[i])
print(blue.."blue" .. i)
end
for i = 1, purple do
hrt5[i] = display.newImage("์ด๋ฏธ์ง/ํธ๊ฐ๋/ํธ๊ฐ๋ ํํธ.png")
hrt5[i].x, hrt5[i].y = display.contentWidth*(0.538 + ((i-1) * 0.025)), display.contentHeight*0.792
hrt5[i].alpha = 0
sceneGroup:insert(hrt5[i])
print(purple.."purple" .. i)
end
loadedSettings.month = loadedSettings.month -1
if loadedSettings.month == 0 then
month.text = "์ด๋ฅธ ๋ด์ ๋ฌ"
elseif loadedSettings.month == 1 then
month.text = "๊ฝ ํผ๋ ๋ฌ"
elseif loadedSettings.month == 2 then
month.text = "ํด๋ณ๋ฌ"
elseif loadedSettings.month == 3 then
month.text = "๋จํ๋ฌ"
elseif loadedSettings.month == 4 then
month.text = "๋ํ ๋ฆฌ ๋ฌ"
elseif loadedSettings.month ==5 then
month.text = "๋๊ฝ ๋ฌ"
end
local options = {
effect="fade",
time = 1000
}
print("likeability")
local function touch(event)
letter1.alpha = 0
my_daesapan.alpha= 0
letter2.alpha = 1
text.alpha = 0
text2.alpha = 0
month.alpha = 0
former2.alpha = 0
former.alpha = 0
next2.alpha = 0
next1.alpha = 0
bt.alpha = 1
rect.alpha = 0.5
--hrt5.alpha = 1
for i = 1,red do
hrt1[i].alpha = 1
end
for i = 1,green do
hrt2[i].alpha = 1
end
for i = 1,yellow do
hrt3[i].alpha = 1
end
for i = 1,blue do
hrt4[i].alpha = 1
end
for i = 1,purple do
hrt5[i].alpha = 1
end
letter1:removeEventListener("touch",touch)
end
local function touch2(event)
loadedSettings.month = loadedSettings.month + 1
if loadedSettings.month == 6 then
print("byebye")
composer.removeScene("likeability")
if find1 == 1 then
composer.setVariable("find1", 2)
loadsave.saveTable(loadedSettings,"settings.json")
composer.gotoScene("item_find_event",options)
elseif find2 == 1 then
composer.setVariable("find2", 2)
loadsave.saveTable(loadedSettings,"settings.json")
composer.gotoScene("item_find_event",options)
elseif find3 == 1 then
composer.setVariable("find3", 2)
loadsave.saveTable(loadedSettings,"settings.json")
composer.gotoScene("item_find_event",options)
elseif find4 == 1 then
composer.setVariable("find4", 2)
loadsave.saveTable(loadedSettings,"settings.json")
composer.gotoScene("item_find_event",options)
elseif find5 == 1 then
composer.setVariable("find5", 2)
loadsave.saveTable(loadedSettings,"settings.json")
composer.gotoScene("item_find_event",options)
else
composer.gotoScene("view99end",options)
end
else
composer.removeScene("likeability")
print(find1)
if find1 == 1 then
composer.setVariable("find1", 2)
loadsave.saveTable(loadedSettings,"settings.json")
composer.gotoScene("item_find_event",options)
elseif find2 == 1 then
composer.setVariable("find2", 2)
loadsave.saveTable(loadedSettings,"settings.json")
composer.gotoScene("item_find_event",options)
elseif find3 == 1 then
composer.setVariable("find3", 2)
loadsave.saveTable(loadedSettings,"settings.json")
composer.gotoScene("item_find_event",options)
elseif find4 == 1 then
composer.setVariable("find4", 2)
loadsave.saveTable(loadedSettings,"settings.json")
composer.gotoScene("item_find_event",options)
elseif find5 == 1 then
composer.setVariable("find5", 2)
loadsave.saveTable(loadedSettings,"settings.json")
composer.gotoScene("item_find_event",options)
else
composer.gotoScene("view01_month",options)
end
end
end
letter1:addEventListener("tap",touch)
bt:addEventListener("tap",touch2)
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("View13Plan")
-- Called when the scene is now off screen
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