forked from dulsi/mari0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
credits.lua
31 lines (28 loc) · 758 Bytes
/
credits.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
function credits_load()
credits_pos = 200
love.graphics.setBackgroundColor(0, 0, 0)
creditstxt = {}
for line in love.filesystem.lines("credits.txt") do
table.insert(creditstxt, line)
end
end
function credits_update(dt)
local n = #creditstxt
if (credits_pos + n * 8 > -8) then
credits_pos = credits_pos - (10 * dt);
else
gamestate = "menu"
love.graphics.setBackgroundColor(backgroundcolor[1])
end
end
function credits_draw()
for i,line in ipairs(creditstxt) do
if (credits_pos + i * 8 > -8) and (credits_pos + i * 8 < 250) then
properprint(line, uispace*.5 - 40*scale, (credits_pos + i * 8)*scale)
end
end
end
function credits_keypressed(key, unicode)
gamestate = "menu"
love.graphics.setBackgroundColor(backgroundcolor[1])
end