level chooser and dotted lines for levels. #8

Merged
pyrex merged 2 commits from kistaro/chameleonic:level-chooser-rebased into main 2022-12-19 07:57:37 +00:00
Showing only changes of commit 78e87ffd55 - Show all commits

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)