Write a crappy level selector for debug/dev purposes.

This commit is contained in:
Kistaro Windrider 2022-12-18 23:50:09 -08:00
parent 0c0a460688
commit 78e87ffd55
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -145,6 +145,8 @@ add(modules,title)
function title:init() function title:init()
end end
blinkcol = 10
function title:draw() function title:draw()
cls(0) cls(0)
-- this is right for 72x32 -- this is right for 72x32
@ -152,10 +154,30 @@ function title:draw()
print("pyrex",32,73,7) print("pyrex",32,73,7)
print("[nyeogmi]",62,73,7) print("[nyeogmi]",62,73,7)
print("kistaro",32,79,7) print("kistaro",32,79,7)
local lvlstr = "⬅️ "..start_level.." ➡️"
print(lvlstr,50,91,1)
print(lvlstr,51,90,blinkcol)
end end
start_level = 0
max_level=15
function title:update() function title:update()
if btn()!=0 then if time()*4\1%2==0 then
blinkcol=10
else
blinkcol=9
end
if btnp(0) then
start_level -= 1
if (start_level<0) start_level=max_level
end
if btnp(1) then
start_level += 1
if (start_level>max_level) start_level=0
end
if btnp(4) or btnp(5) then
modules=real_modules modules=real_modules
_init() _init()
music(0) music(0)
@ -167,7 +189,7 @@ level={}
add(real_modules,level) add(real_modules,level)
function level:init() function level:init()
level:reinit(0) level:reinit(start_level)
end end
function level:reinit(n) function level:reinit(n)