-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
583 lines (505 loc) · 21.6 KB
/
Copy pathmain.lua
File metadata and controls
583 lines (505 loc) · 21.6 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
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
-- [[ main.lua - 하위 폴더 폰트 경로 반영 및 초기화면 언어변경 제한 버전 ]]
local Text = require("text")
local L = Text.EN
local Game = {
state = "START",
wave = 1,
max_wave = 5,
hp = 5,
max_hp = 5,
food = 3,
research = 0,
max_research = 3,
enemy_atk = 1,
rerolls_left = 1,
log = ""
}
local Dice = {}
local Rolling = { active = false, time = 0, duration = 0.6, interval = 0.06, nextFlip = 0, targets = {} }
local Images = {}
-- Splash parallax parameters / state (virtual coordinates)
local SPLASH_PARALLAX_MAX = 12
local SPLASH_PARALLAX_SPEED = 1.2
local splashOffsetX, splashOffsetY = 0, 0
local splashTime = 0
local TARGET_DICE_SIZE = 80
local TARGET_OVERLAY_SIZE = 90
-- 가상 해상도: 게임 로직/렌더링은 이 해상도로 작업하고, 실제 창 크기에 맞춰 스케일링합니다.
local VIRTUAL_W, VIRTUAL_H = 500, 600
-- 현재 윈도우 상태를 저장할 변수
local WIN_W, WIN_H = VIRTUAL_W, VIRTUAL_H
local SCALE_X, SCALE_Y = 1, 1
local OFFSET_X, OFFSET_Y = 0, 0
local IsPortrait = true
local function updateTransform()
WIN_W, WIN_H = love.graphics.getWidth(), love.graphics.getHeight()
-- Portrait 여부 판정: 세로가 가로보다 긴 경우에 portrait로 본다
IsPortrait = WIN_H >= WIN_W
-- 비균일 스케일: 창 크기에 맞춰 X/Y 각각 늘려 화면을 채우도록 함 (stretch)
SCALE_X = WIN_W / VIRTUAL_W
SCALE_Y = WIN_H / VIRTUAL_H
-- 스트레치 모드는 여백이 없으므로 오프셋은 0
OFFSET_X = 0
OFFSET_Y = 0
end
local function toVirtual(x, y)
return (x - OFFSET_X) / SCALE_X, (y - OFFSET_Y) / SCALE_Y
end
-- OS 언어 환경 자동 감지 함수
function DetectOSLanguage()
local os_name = love.system.getOS()
local lang_env = os.getenv("LANG") or os.getenv("LC_ALL") or os.getenv("LC_CTYPE") or ""
lang_env = lang_env:lower()
if string.find(lang_env, "ko") or (os_name == "Windows" and string.find(lang_env, "korean")) then
L = Text.KR
else
L = Text.EN
end
end
function ResetGame()
Game.state = "PLAY"
Game.wave = 1
Game.hp = 5
Game.max_hp = 5
Game.food = 3
Game.research = 0
Game.max_research = 3
Game.enemy_atk = 1
Game.rerolls_left = 1
Game.log = string.format(L.log_wave, 1)
Dice = {}
for i = 1, 4 do
table.insert(Dice, { value = 1, kept = false, locked = false, display = 1 })
end
end
function RollDice()
if Game.rerolls_left <= 0 or Rolling.active then return end
-- 시작: 애니메이션 상태로 전환하고 최종 목표값을 미리 정해둠
Rolling.active = true
Rolling.time = 0
Rolling.nextFlip = Rolling.interval
Rolling.targets = {}
for i, d in ipairs(Dice) do
if not d.locked and not d.kept then
Rolling.targets[i] = math.random(1, 6)
else
Rolling.targets[i] = d.value
end
end
Game.log = L.log_rolling or L.log_start
end
function love.update(dt)
if Rolling.active then
Rolling.time = Rolling.time + dt
Rolling.nextFlip = Rolling.nextFlip - dt
-- 빠르게 표시를 바꿔서 굴리는 듯한 효과를 냄
if Rolling.nextFlip <= 0 then
Rolling.nextFlip = Rolling.nextFlip + Rolling.interval
for i, d in ipairs(Dice) do
if not d.locked and not d.kept then
d.display = math.random(1, 6)
end
end
end
-- 애니메이션 완료 처리
if Rolling.time >= Rolling.duration then
Rolling.active = false
-- 최종 값 적용 및 잠금 처리
for i, d in ipairs(Dice) do
if not d.locked and not d.kept then
d.value = Rolling.targets[i]
d.display = d.value
if d.value == 5 then
d.locked = true
Game.log = L.log_skull
end
end
end
Game.rerolls_left = Game.rerolls_left - 1
end
end
-- 스플래시 패럴랙스 업데이트
splashTime = splashTime + dt
if Game.state == "START" and Images["splash"] then
local mx, my = love.mouse.getPosition()
mx, my = toVirtual(mx, my)
local cx, cy = VIRTUAL_W / 2, VIRTUAL_H / 2
local nx = (mx - cx) / (VIRTUAL_W / 2)
local ny = (my - cy) / (VIRTUAL_H / 2)
local targetX = -nx * SPLASH_PARALLAX_MAX
local targetY = -ny * (SPLASH_PARALLAX_MAX * 0.6) + math.sin(splashTime * SPLASH_PARALLAX_SPEED) * 2
local lerp = math.min(1, 6 * dt)
splashOffsetX = splashOffsetX + (targetX - splashOffsetX) * lerp
splashOffsetY = splashOffsetY + (targetY - splashOffsetY) * lerp
else
-- 서서히 원위치로 복귀
splashOffsetX = splashOffsetX * (1 - math.min(1, 4 * dt))
splashOffsetY = splashOffsetY * (1 - math.min(1, 4 * dt))
end
end
function EndTurn()
local atk_mod = (Game.research >= 3) and 2 or 1
local sword, shield, food_gain, scroll, skull, star = 0, 0, 0, 0, 0, 0
for i, d in ipairs(Dice) do
if d.value == 1 then sword = sword + 1
elseif d.value == 2 then shield = shield + 1
elseif d.value == 3 then food_gain = food_gain + 1
elseif d.value == 4 then scroll = scroll + 1
elseif d.value == 5 then skull = skull + 1
elseif d.value == 6 then star = star + 1 end
end
if Game.research >= 1 then
for i, d in ipairs(Dice) do
if not d.locked then
star = star + 1
break
end
end
end
local needed_def = Game.enemy_atk
local current_def = sword * atk_mod
while star > 0 and current_def < needed_def do
current_def = current_def + atk_mod
star = star - 1
end
while star > 0 do
if scroll % 2 == 1 then scroll = scroll + 1
else food_gain = food_gain + 1 end
star = star - 1
end
for i = 1, skull do
if Game.food > 0 then Game.food = Game.food - 1
else Game.hp = Game.hp - 1 end
end
Game.hp = math.min(Game.max_hp, Game.hp + shield)
Game.food = Game.food + food_gain
if scroll >= 2 then
Game.research = math.min(Game.max_research, Game.research + math.floor(scroll / 2))
if Game.research >= 2 then Game.max_hp = 7 end
end
local damage_taken = math.max(0, Game.enemy_atk - current_def)
Game.hp = Game.hp - damage_taken
if Game.food > 0 then Game.food = Game.food - 1
else Game.hp = Game.hp - 1 end
Game.log = string.format(L.log_result, damage_taken)
if Game.hp <= 0 then
Game.state = "GAMEOVER"
return
end
if Game.wave >= Game.max_wave then
Game.state = "WIN"
return
end
Game.wave = Game.wave + 1
Game.enemy_atk = Game.wave
Game.rerolls_left = 1
for _, d in ipairs(Dice) do
d.kept = false
d.locked = false
d.value = 1
end
end
function love.load()
love.window.setTitle("The Lonely Keep")
-- 윈도우를 가상 해상도로 설정하되 리사이즈 허용
love.window.setMode(VIRTUAL_W, VIRTUAL_H, {resizable = true, minwidth = 320, minheight = 240})
DetectOSLanguage()
L = Text.KR
Game.log = L.log_start
-- 랜덤 시드: 한 번만 설정
math.randomseed(os.time())
-- 🔤 [요청하신 D2Coding 폰트 하위 폴더 경로 반영]
local fontPath = "fonts/D2CodingLigatureNerdFont-Regular.ttf"
local font
if love.filesystem.getInfo(fontPath) then
font = love.graphics.newFont(fontPath, 14)
else
-- 폰트 파일 경로에 파일이 없을 경우 대비한 내장 안전 백업 폰트
font = love.graphics.newFont(14)
end
love.graphics.setFont(font)
Images[1] = love.graphics.newImage("image/sword.png")
Images[2] = love.graphics.newImage("image/shield.png")
Images[3] = love.graphics.newImage("image/food.png")
Images[4] = love.graphics.newImage("image/scroll.png")
Images[5] = love.graphics.newImage("image/skull.png")
Images[6] = love.graphics.newImage("image/star.png")
Images["keep"] = love.graphics.newImage("image/keep.png")
Images["lock"] = love.graphics.newImage("image/lock.png")
Images["castle"] = love.graphics.newImage("image/castle.png")
-- 스플래시 이미지(시작 화면 배경)
if love.filesystem.getInfo("image/splash.jpg") then
Images["splash"] = love.graphics.newImage("image/splash.jpg")
end
-- 승리 화면 이미지
if love.filesystem.getInfo("image/victory.jpg") then
Images["victory"] = love.graphics.newImage("image/victory.jpg")
end
-- 게임 오버 화면 이미지
if love.filesystem.getInfo("image/game-over.jpg") then
Images["gameover"] = love.graphics.newImage("image/game-over.jpg")
end
Images["scroll2"] = love.graphics.newImage("image/scroll2.png")
ResetGame()
Game.state = "START"
-- 초기 변환 계산
updateTransform()
end
function love.draw()
love.graphics.clear(0.12, 0.12, 0.15)
-- 가상 화면으로 스케일/오프셋 적용
love.graphics.push()
love.graphics.translate(OFFSET_X, OFFSET_Y)
love.graphics.scale(SCALE_X, SCALE_Y)
-- 언어전환 버튼은 오직 START(초기화면) 상태에서만 렌더링
if Game.state == "START" then
love.graphics.setColor(0.2, 0.2, 0.25)
love.graphics.rectangle("fill", 350, 15, 120, 30, 4, 4)
love.graphics.setColor(1, 1, 1)
love.graphics.rectangle("line", 350, 15, 120, 30, 4, 4)
love.graphics.printf(L.lang_btn, 350, 22, 120, "center")
end
if Game.state == "START" then
-- 스플래시 배경이 있으면 전체에 그리기
local splash = Images["splash"]
if splash then
local sx = VIRTUAL_W / splash:getWidth()
local sy = VIRTUAL_H / splash:getHeight()
-- 화면에 맞게 스케일, 약한 패럴랙스 오프셋 적용
love.graphics.draw(splash, splashOffsetX, splashOffsetY, 0, sx, sy)
-- 아래쪽 텍스트 가독성 보정용 반투명 박스
love.graphics.setColor(0, 0, 0, 0.35)
love.graphics.rectangle("fill", 0, VIRTUAL_H - 160, VIRTUAL_W, 160)
love.graphics.setColor(1, 1, 1)
end
-- 제목/부제 위치 조정 (제목 파란색)
love.graphics.setColor(0.2, 0.6, 1)
love.graphics.printf(L.title, 0, 60, 500, "center")
love.graphics.setColor(1, 1, 1)
love.graphics.printf(L.subtitle, 40, 140, 420, "center")
-- 언어 버튼을 시작화면 위에 다시 그려 클릭을 보장
love.graphics.setColor(0.2, 0.2, 0.25)
love.graphics.rectangle("fill", 350, 15, 120, 30, 4, 4)
love.graphics.setColor(1, 1, 1)
love.graphics.rectangle("line", 350, 15, 120, 30, 4, 4)
love.graphics.printf(L.lang_btn, 350, 22, 120, "center")
-- 시작 버튼을 화면 하단에 배치
love.graphics.setColor(0.2, 0.4, 0.7)
love.graphics.rectangle("fill", 160, 460, 180, 50, 6, 6)
love.graphics.setColor(1, 1, 1)
love.graphics.rectangle("line", 160, 460, 180, 50, 6, 6)
love.graphics.printf(L.start_btn, 160, 470, 180, "center")
elseif Game.state == "PLAY" then
love.graphics.printf(string.format(L.day, Game.wave, Game.max_wave), 30, 30, 400)
love.graphics.printf(string.format(L.enemy_atk, Game.enemy_atk), 30, 55, 400)
-- 게임 중 타이틀(또는 종료)로 돌아가는 버튼
love.graphics.setColor(0.3, 0.2, 0.25)
love.graphics.rectangle("fill", 350, 15, 120, 30, 4, 4)
love.graphics.setColor(1,1,1)
love.graphics.rectangle("line", 350, 15, 120, 30, 4, 4)
love.graphics.printf(L.exit_btn, 350, 22, 120, "center")
love.graphics.rectangle("line", 25, 90, 450, 120)
-- 왼쪽: 텍스트 레이블, 오른쪽: 아이콘
local leftX = 40
-- 오른쪽 아이콘 위치를 왼쪽으로 이동해서 여백 확보
local rightX = 320
-- 성벽(체력) 텍스트
love.graphics.setColor(1, 1, 1)
love.graphics.print(string.format(L.hp, Game.hp, Game.max_hp), leftX, 105)
-- 성벽 아이콘 (castle) 슬롯
local castleImg = Images["castle"] or Images["keep"]
if castleImg then
local ICON_SIZE = 22
for i = 1, Game.max_hp do
local ix = rightX + (i - 1) * (ICON_SIZE + 6)
local iy = 102
if i <= Game.hp then love.graphics.setColor(1,1,1)
else love.graphics.setColor(0.35,0.35,0.4) end
local csx = ICON_SIZE / castleImg:getWidth()
local csy = ICON_SIZE / castleImg:getHeight()
love.graphics.draw(castleImg, ix, iy, 0, csx, csy, 0, 0)
end
love.graphics.setColor(1,1,1)
end
-- 식량 텍스트
love.graphics.print(string.format(L.food, Game.food), leftX, 135)
-- 식량 아이콘과 숫자
local foodImg = Images[3]
if foodImg then
local ICON_SIZE = 18
local fx = rightX
local fy = 132
local fsx = ICON_SIZE / foodImg:getWidth()
local fsy = ICON_SIZE / foodImg:getHeight()
-- 현재 식량 수만큼 아이콘을 연속으로 표시 (최대 6개). 6개 초과 시 텍스트로 표시
local maxIcons = math.min(Game.food, 6)
for i = 1, maxIcons do
local ix = fx + (i - 1) * (ICON_SIZE + 6)
love.graphics.draw(foodImg, ix, fy, 0, fsx, fsy, 0, 0)
end
love.graphics.setColor(1,1,1)
if Game.food > 6 then
love.graphics.print("x" .. tostring(Game.food), fx + (maxIcons) * (ICON_SIZE + 6) + 4, fy - 2)
end
end
-- 연구 텍스트
love.graphics.print(string.format(L.research, Game.research), leftX, 165)
-- 연구 아이콘 슬롯
local scrollImg = Images["scroll2"]
if scrollImg then
local ICON_SIZE = 18
for i = 1, Game.max_research do
local rx = rightX + (i - 1) * (ICON_SIZE + 8)
local ry = 162
-- 항상 원본 색상으로 그리기 (어두운 색조 제거)
love.graphics.setColor(1,1,1)
local rsx = ICON_SIZE / scrollImg:getWidth()
local rsy = ICON_SIZE / scrollImg:getHeight()
love.graphics.draw(scrollImg, rx, ry, 0, rsx, rsy, 0, 0)
end
love.graphics.setColor(1,1,1)
if Game.research > 0 then love.graphics.print(L.research_active, 220, 165) end
end
love.graphics.print(L.dice_guide, 30, 240)
for i, d in ipairs(Dice) do
local x = 30 + (i - 1) * 110
local y = 270
if d.locked then love.graphics.setColor(0.4, 0.1, 0.1)
elseif d.kept then love.graphics.setColor(0.1, 0.4, 0.1)
else love.graphics.setColor(0.2, 0.2, 0.25) end
love.graphics.rectangle("fill", x, y, 90, 90, 8, 8)
love.graphics.setColor(1, 1, 1)
love.graphics.rectangle("line", x, y, 90, 90, 8, 8)
local drawVal = d.display or d.value
local img = Images[drawVal]
local scale_x = TARGET_DICE_SIZE / img:getWidth()
local scale_y = TARGET_DICE_SIZE / img:getHeight()
local cx = x + 45
local cy = y + 45
local r = 0
if Rolling.active and not d.kept and not d.locked then
r = math.sin(Rolling.time * 25 + i) * 0.4
end
love.graphics.draw(img, cx, cy, r, scale_x, scale_y, img:getWidth() / 2, img:getHeight() / 2)
if d.locked then
local lock_img = Images["lock"]
local l_scale_x = TARGET_OVERLAY_SIZE / lock_img:getWidth()
local l_scale_y = TARGET_OVERLAY_SIZE / lock_img:getHeight()
love.graphics.draw(lock_img, x, y, 0, l_scale_x, l_scale_y)
elseif d.kept then
local keep_img = Images["keep"]
local k_scale_x = TARGET_OVERLAY_SIZE / keep_img:getWidth()
local k_scale_y = TARGET_OVERLAY_SIZE / keep_img:getHeight()
love.graphics.draw(keep_img, x, y, 0, k_scale_x, k_scale_y)
end
end
love.graphics.setColor(0.2, 0.4, 0.7)
love.graphics.rectangle("fill", 50, 420, 180, 50, 5, 5)
love.graphics.setColor(1, 1, 1)
love.graphics.rectangle("line", 50, 420, 180, 50, 5, 5)
love.graphics.printf(string.format(L.btn_roll, Game.rerolls_left), 50, 425, 180, "center")
love.graphics.setColor(0.7, 0.4, 0.2)
love.graphics.rectangle("fill", 270, 420, 180, 50, 5, 5)
love.graphics.setColor(1, 1, 1)
love.graphics.rectangle("line", 270, 420, 180, 50, 5, 5)
love.graphics.printf(L.btn_def, 270, 435, 180, "center")
love.graphics.setColor(0.8, 0.8, 0.5)
love.graphics.printf("Log: " .. Game.log, 30, 510, 440, "center")
elseif Game.state == "WIN" then
local victory = Images["victory"]
if victory then
local sx = VIRTUAL_W / victory:getWidth()
local sy = VIRTUAL_H / victory:getHeight()
love.graphics.draw(victory, 0, 0, 0, sx, sy)
-- 이미지 위에 텍스트 가독성용 반투명 박스와 텍스트 오버레이
local boxY = VIRTUAL_H / 2 - 80
love.graphics.setColor(0, 0, 0, 0.45)
love.graphics.rectangle("fill", 0, boxY, VIRTUAL_W, 160)
love.graphics.setColor(1, 1, 1)
love.graphics.printf(L.win_title, 0, boxY + 8, VIRTUAL_W, "center")
love.graphics.printf(L.win_msg, 40, boxY + 48, VIRTUAL_W - 80, "center")
love.graphics.printf(L.win_btn, 0, VIRTUAL_H - 80, VIRTUAL_W, "center")
else
love.graphics.setColor(0.2, 0.7, 0.2)
love.graphics.printf(L.win_title, 0, 200, 500, "center")
love.graphics.setColor(1, 1, 1)
love.graphics.printf(L.win_msg, 40, 250, 420, "center")
love.graphics.printf(L.win_btn, 0, 400, 500, "center")
end
elseif Game.state == "GAMEOVER" then
local go = Images["gameover"]
if go then
local sx = VIRTUAL_W / go:getWidth()
local sy = VIRTUAL_H / go:getHeight()
love.graphics.draw(go, 0, 0, 0, sx, sy)
-- 이미지 위에 텍스트 가독성용 반투명 박스와 텍스트 오버레이
local boxY = VIRTUAL_H / 2 - 80
love.graphics.setColor(0, 0, 0, 0.45)
love.graphics.rectangle("fill", 0, boxY, VIRTUAL_W, 160)
love.graphics.setColor(1, 1, 1)
love.graphics.printf(L.over_title, 0, boxY + 8, VIRTUAL_W, "center")
love.graphics.printf(string.format(L.over_msg, Game.wave), 40, boxY + 48, VIRTUAL_W - 80, "center")
love.graphics.printf(L.win_btn, 0, VIRTUAL_H - 80, VIRTUAL_W, "center")
else
love.graphics.setColor(0.7, 0.2, 0.2)
love.graphics.printf(L.over_title, 0, 200, 500, "center")
love.graphics.setColor(1, 1, 1)
love.graphics.printf(string.format(L.over_msg, Game.wave), 0, 250, 500, "center")
love.graphics.printf(L.win_btn, 0, 400, 500, "center")
end
end
-- 스케일/오프셋 해제
love.graphics.pop()
end
function love.mousereleased(x, y, button, istouch, presses)
if button == 1 then
-- 창이 스케일되었으므로 실제 마우스 좌표를 가상 좌표로 변환
local vx, vy = toVirtual(x, y)
-- 언어 토글 버튼 감지 영역 (초기화면 제한)
if Game.state == "START" and vx >= 350 and vx <= 470 and vy >= 15 and vy <= 45 then
if L == Text.EN then L = Text.KR else L = Text.EN end
Game.log = L.log_start
return
end
-- PLAY 상태에서 우측 상단의 Exit 버튼 클릭시 타이틀로 이동
if Game.state == "PLAY" and vx >= 350 and vx <= 470 and vy >= 15 and vy <= 45 then
Game.state = "START"
Game.log = L.log_start
return
end
-- START: 시작 화면에서 클릭하면 게임 시작
if Game.state == "START" then
ResetGame()
return
end
-- WIN / GAMEOVER: 클릭하면 초기(Start) 화면으로 돌아가기
if Game.state == "WIN" or Game.state == "GAMEOVER" then
Game.state = "START"
Game.log = L.log_start
return
end
if Game.state == "PLAY" then
for i = 1, 4 do
local dx = 30 + (i - 1) * 110
local dy = 270
if vx >= dx and vx <= dx + 90 and vy >= dy and vy <= dy + 90 then
if Rolling.active then return end
if not Dice[i].locked then
Dice[i].kept = not Dice[i].kept
end
return
end
end
if vx >= 50 and vx <= 230 and vy >= 420 and vy <= 470 then
if Game.rerolls_left > 0 then RollDice()
else Game.log = L.log_noreroll end
end
if vx >= 270 and vx <= 450 and vy >= 420 and vy <= 470 then
EndTurn()
end
end
end
end
function love.resize(w, h)
updateTransform()
end