-
Notifications
You must be signed in to change notification settings - Fork 0
/
final.lua
56 lines (46 loc) · 1.23 KB
/
final.lua
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
-- final.lua: Overlay used when you've completed the final level.
overlays.final = {}
local gui = {
back = {
type = "button",
x = 480, y = 40*13,
size = { x = 40*8, y = 96 },
label = S("yay ^-^"),
on_click = function()
switchOverlay(false)
switchState("selectlevel")
end
},
}
function overlays.final.init()
sounds.success:clone():play()
-- If this is the latest level, unlock the next level.
if game.level == game.levelsUnlocked then
game.levelsUnlocked = game.levelsUnlocked + 1
savegame.set('levelsUnlocked', game.levelsUnlocked)
end
end
function overlays.final.update()
gtk.update(gui, true)
end
local text = {
"Congratulations, you've",
"completed all the levels",
"currently in the game!",
"",
"Stay tuned for new updates",
"with more levels..."}
function overlays.final.draw()
love.graphics.setColor(64/255, 120/255, 161/255,0.9)
love.graphics.rectangle('fill', 380, 20, 520, 680)
love.graphics.setColor(1,1,1,1)
love.graphics.setFont(fonts.sans.bigger)
drawCenteredText(4, 64, base_resolution.x, 64, S("Level Complete!"))
love.graphics.setFont(fonts.sans.medium)
local y = 32*5
for _,t in pairs(text) do
drawCenteredText(0, y, base_resolution.x, 32, t)
y = y + 48
end
gtk.draw(gui, true)
end