time left
This commit is contained in:
parent
fc209f724e
commit
5cc1cbc66a
10
toomgis.p8
10
toomgis.p8
@ -171,6 +171,7 @@ levels = {
|
||||
},
|
||||
}
|
||||
lvl = levels[1]
|
||||
lvl_start_time = 1
|
||||
horizon = 64
|
||||
items = {
|
||||
{x=0, y=0, n=0},
|
||||
@ -219,7 +220,6 @@ function level_draw()
|
||||
|
||||
-- hud
|
||||
local size = max(flr(pieces/MAX_PIECES*100), 1)
|
||||
local time_left = 10
|
||||
local streak_str = streak2mult()
|
||||
if streak_str == 1 then
|
||||
streak_str = ""
|
||||
@ -227,11 +227,15 @@ function level_draw()
|
||||
streak_str = streak_str.."X"
|
||||
end
|
||||
rectfill(0, 0, 128, 8, 2)
|
||||
print("size "..size..lvl.unit.." "..streak_str.." ", 1, 1, 9)
|
||||
print(time_left.."S", 70, 1, 9)
|
||||
print("SIZE "..size..lvl.unit.." "..streak_str.." ", 1, 1, 9)
|
||||
print(time_left().."S", 60, 1, 9)
|
||||
print("GOAL 100"..lvl.unit, 88, 1, 9)
|
||||
end
|
||||
|
||||
function time_left()
|
||||
return flr(max(0, (90+lvl_start_time)-time()))
|
||||
end
|
||||
|
||||
function streak2mult()
|
||||
if streak > 20 then
|
||||
return 5
|
||||
|
Loading…
Reference in New Issue
Block a user