level templates on the map, thrown-together level chooser #7

Closed
kistaro wants to merge 3 commits from kistaro:level-chooser into main
Showing only changes of commit 8c2b96e8fc - Show all commits

View File

@ -145,6 +145,8 @@ add(modules,title)
function title:init()
end
blinkcol = 10
function title:draw()
cls(0)
-- this is right for 72x32
@ -152,10 +154,30 @@ function title:draw()
print("pyrex",32,73,7)
print("[nyeogmi]",62,73,7)
print("kistaro",32,79,7)
local lvlstr = "⬅️ "..start_level.." ➡️"
print(lvlstr,50,91,1)
print(lvlstr,51,90,blinkcol)
end
start_level = 0
max_level=15
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
_init()
music(0)
@ -167,7 +189,7 @@ level={}
add(real_modules,level)
function level:init()
level:reinit(0)
level:reinit(start_level)
end
function level:reinit(n)