-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtitle2.lua
More file actions
452 lines (381 loc) Β· 11.7 KB
/
Copy pathtitle2.lua
File metadata and controls
452 lines (381 loc) Β· 11.7 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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
local loadsave = require( "loadsave" )
local composer = require( "composer" )
local scene = composer.newScene()
local json = require( "json" )
function scene:create( event )
local sceneGroup = self.view
print("title2")
--λ‘λ
local loadedEndings = loadsave.loadTable( "endings.json" )
--local titleMusic = audio.loadStream( "μμ
/νμ΄ν.mp3" )
local background = display.newImageRect("μ΄λ―Έμ§/νμ΄ν/λ©μΈ.png",display.contentWidth, display.contentHeight)
background.x,background.y = display.contentWidth/2,display.contentHeight/2
sceneGroup:insert(background)
local ending = display.newImage("μ΄λ―Έμ§/νμ΄ν/μλ©λͺ¨μ.png")
ending.x, ending.y = display.contentWidth*0.05,display.contentHeight*0.9
sceneGroup:insert(ending)
--ν¬λ λ§ λ²νΌ
local credit = display.newImage("μ΄λ―Έμ§/ν¬λ λ§/λ²νΌ.png")
credit.x, credit.y = display.contentWidth*0.95,display.contentHeight*0.9
sceneGroup:insert(credit)
--credit:addEventListener("touch",move)
--μ€νμ
λ²νΌ
local special = display.newImage("μ΄λ―Έμ§/νΉλ³μΌλ¬μ€νΈ/λ²νΌ.png")
special.x, special.y = display.contentWidth*0.13,display.contentHeight*0.9
sceneGroup:insert(special)
local volumeButton = display.newImage("μ΄λ―Έμ§/νμ΄ν/μ€μ .png")
volumeButton.x,volumeButton.y = display.contentWidth * 0.87, display.contentHeight * 0.9
sceneGroup:insert(volumeButton)
local newgame = display.newImage("μ΄λ―Έμ§/νμ΄ν/μκ²μ.png")
newgame.x,newgame.y = display.contentWidth * 0.42, display.contentHeight * 0.9
sceneGroup:insert(newgame)
local loadgame = display.newImage("μ΄λ―Έμ§/νμ΄ν/λ‘λλ²νΌ.png")
loadgame.x,loadgame.y = display.contentWidth * 0.58, display.contentHeight * 0.9
sceneGroup:insert(loadgame)
local titlePopup = display.newImage("μ΄λ―Έμ§/νμ΄ν/μ΄λ¦μ€μ νμ
.png")
titlePopup.x,titlePopup.y = display.contentWidth/2,display.contentHeight/2
titlePopup.alpha = 0
sceneGroup:insert(titlePopup)
local titleButton = display.newImage("μ΄λ―Έμ§/νμ΄ν/μ΄λ¦κ²°μ .png")
titleButton.x,titleButton.y = display.contentWidth/2,display.contentHeight * 0.65
titleButton.alpha = 0
sceneGroup:insert(titleButton)
--μ΄λ¦ μ
λ ₯μ μν ν
μ€νΈμμ μμ±--
local defaultField
local function textListener( event )
if ( event.phase == "began" ) then
-- User begins editing "defaultField"
elseif ( event.phase == "ended" or event.phase == "submitted" ) then
-- Output resulting text from "defaultField"
print( event.target.text )
elseif ( event.phase == "editing" ) then
print( event.newCharacters )
print( event.oldText )
print( event.startPosition )
print( event.text )
end
end
titlePopup.alpha = 1
titleButton.alpha = 1
-- Create text field
local function make_text()
defaultField = native.newTextField( display.contentWidth/2,display.contentHeight * 0.56, 370, 60 )
defaultField:addEventListener( "userInput", textListener )
defaultField.font = native.newFont( "font/μν리λμ€λ Medium.ttf", 40)
defaultFied = ""
defaultField.align = "center"
sceneGroup:insert(defaultField)
end
make_text()
-- κ²μ νλ©΄
local back = display.newRect(display.contentWidth/2,display.contentHeight/2, display.contentWidth,display.contentHeight)
back:setFillColor(0)
sceneGroup:insert(back)
back.alpha = 0
-- νλ©΄μ ν μ΄ννΈ
local options={
effect = "fade",
time = 2000
}
local function gotomap(event)
if event.phase == "began" then
event.target.width,event.target.height = 68.82,68.82
elseif event.phase == "cancelled" then
event.target.width,event.target.height = 74,74
elseif event.phase == "ended" then
event.target.width,event.target.height = 74,74
defaultField:removeSelf()
defaultField = nil
composer.removeScene("title2")
composer.gotoScene("title")
end
end
local exit1 = display.newImage("μ΄λ―Έμ§/곡ν΅/μμxλ²νΌ.png")
sceneGroup:insert(exit1)
exit1.x, exit1.y = display.contentWidth*0.68, display.contentHeight*0.28
exit1:addEventListener("touch",gotomap)
local function startNew(event)
--μκΉ λλ μ΄λ¦μ μ ννμ§ μμμ μ μλ¬ νμ
μ°½μΌλ‘ λμ΄κ°λ€
if defaultField.text == "" then
defaultField:removeSelf()
defaultField = nil
composer.removeScene("title2")
composer.gotoScene("title2_1")
else
--κ²μ μ§νμ μν μ μ₯ λ°μ΄ν°λ€ μμ±
loadedEndings = loadsave.loadTable( "endings.json" )
loadedEndings.end_num = 0
loadsave.saveTable(loadedEndings,"endings.json")
local gameSettings = {
money = 2000,
fun = 0,
hobby = 0,
study = 0,
friendship =0,
red = 0,
yellow = 0,
green = 0,
blue = 0,
purple = 0,
month = 0,
limited_num= 0,
red_num = 0,
blue_num = 0,
yellow_num = 0,
green_num = 0,
purple_num = 0,
game_num = 0,
activity_num = 0,
friend_num = 0,
gift_num=0,
play1_num =0,
play2_num=0,
play3_num=0,
play4_num=0,
play5_num=0,
hobby1_num = 0,
hobby2_num = 0,
hobby3_num = 0,
hobby4_num = 0,
hobby5_num = 0,
study1_num = 0,
study2_num = 0,
study3_num = 0,
study4_num = 0,
study5_num = 0,
friend1_num = 0,
friend2_num = 0,
friend3_num = 0,
friend4_num = 0,
friend5_num = 0,
show1 = 0,
show2= 0,
show3= 0,
show4= 0,
show5= 0,
show6= 0,
show7= 0,
month1_event = 0,
month2_event = 0,
month3_event = 0,
month4_event = 0,
month5_event = 0,
month6_event = 0,
tutorial = 0,
badWhite = 0,
goodWhite = 0,
former1 = "",
former2 = "",
former01 = "",
former02 = "",
next1 = "",
next2 = "",
name = defaultField.text,
test = 0,
script2 = 0,
script4 = 0,
script6 = 0
}
loadsave.saveTable( gameSettings, "settings.json" )
local itme = {
itemCount = 0,
item1 = "μμ",
item2 = "μμ",
item3 = "μμ",
item4 = "μμ",
item5 = "μμ",
item6 = "μμ",
item7 = "μμ",
item8 = "μμ",
item9 = "μμ",
item10 = "μμ",
item11 = "μμ",
item12 = "μμ",
item13 = "μμ",
item14 = "μμ",
item15 = "μμ",
item16 = "μμ",
item17 = "μμ",
item1Count = 0,
item2Count = 0,
item3Count = 0,
item4Count = 0,
item5Count = 0,
item6Count = 0,
item7Count = 0,
item8Count = 0,
item9Count = 0,
item10Count = 0,
item11Count = 0,
item12Count = 0,
item13Count = 0,
item14Count = 0,
item15Count = 0,
item16Count = 0,
item17Count = 0,
decoCount = 0,
deco1 = "μμ",
deco2 = "μμ",
deco3 = "μμ",
deco4 = "μμ",
deco5 = "μμ",
deco6 = "μμ",
deco7 = "μμ",
deco8 = "μμ",
deco9 = "μμ",
deco10 = "μμ",
deco11 = "μμ",
deco12 = "μμ",
deco13 = "μμ",
deco14 = "μμ",
deco15 = "μμ",
d1Sold=1,
d2Sold=1,
d3Sold=1,
d4Sold=1,
d5Sold=1,
d6Sold=1,
d7Sold=1,
d8Sold=1,
d9Sold=1,
d10Sold=1,
d11Sold=1,
d12Sold=1,
d13Sold=1,
d14Sold=1,
d15Sold=1,
interiorCount = 23,
wallpaper1 = "ν°μλ²½μ§",
wallpaper2 = "μμ",
wallpaper3 = "μμ",
wallpaperCount = 1,
floor1 = "νΈλ₯Έλ°λ₯",
floor2 = "μμ",
floor3 = "μμ",
floorCount = 1,
blanket1 = "νλμ΄λΆ",
blanket2 = "μμ",
blanket3 = "μμ",
blanketCount = 1,
carpet1 = "μμ",
carpet2 = "μμ",
carpet3 = "μμ",
carpetCount = 0,
plant1 = "μμ",
plant2 = "μμ",
plant3 = "μμ",
plant4 = "μμ",
plantCount = 0,
doll1 = "μμ",
doll2 = "μμ",
dollCount = 0,
frame1 = "μμ",
frame2 = "μμ",
frame3 = "μμ",
frame4 = "μμ",
frame5 = "μμ",
frameCount = 0,
grid_apply = 0,
dot_apply = 0,
white_apply = 1,
flower_apply = 0,
sprite_apply = 0,
blue_apply = 1,
tree_apply = 0,
fblue_apply = 1,
fwhite_apply = 0,
square_apply=0,
circle_apply=0,
heart_apply=0,
cactus_apply=0,
violet_apply=0,
sunflower_apply=0,
clover_apply=0,
bear_apply=0,
rabbit_apply=0,
lay_apply=0,
wiz_apply=0,
soli_apply=0,
bly_apply=0,
joy_apply=0,
costume_normal = 1,
costume_walnut = 0,
costume_pirate = 0,
costume_detective = 0,
costume_summer = 0,
costume_devil = 0,
costume_pyjamas = 0,
costume_troublemaker = 0,
costume_nerd = 0,
costume_princess = 0,
costume = "κΈ°λ³Έ",
costumeBuy = {{ name = "κΌ¬λ§μ
λ§", buy = 0, cost = 40},
{ name = "νμ ", buy = 0, cost = 50},
{ name = "ν΄μ ", buy = 0, cost = 50},
{ name = "곡주λ", buy = 0, cost = 50},
{ name = "λ³μ μΈν", buy = 0, cost = 50},
{ name = "μλ©΄μ μ·", buy = 0, cost = 30},
{ name = "μ¬λ¦ν΄λ³", buy = 0, cost = 30},
{ name = "λ§μ½μμ΄", buy = 0, cost = 25},
{ name = "λͺ¨λ²μΉκ΅¬", buy = 0, cost = 25},
{ name = "κΈ°λ³Έ", buy = 1, cost = 0}}
}
local serializedJSON = json.encode(itme)
local itmes = json.decode(serializedJSON)
--loadsave.saveTable(custumeBuy, "items.json")
loadsave.saveTable( itmes ,"items.json" )
composer.setVariable("name",defaultField.text)
defaultField:removeSelf()
defaultField = nil
titleButton.alpha = 0
titlePopup.alpha = 0
exit1.alpha = 0
composer.removeScene("title2")
composer.gotoScene( "tutorial",options)
audio.pause( titleMusic )
local tutorialMusic = audio.loadStream( "μμ
/νν 리μΌ.mp3" )
audio.setVolume( loadedEndings.logValue )
audio.play(tutorialMusic)
end
end
titleButton:addEventListener("tap",startNew)
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
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