Save last played mode. Can start in mode selector.

This commit is contained in:
Kistaro Windrider 2023-07-23 17:15:19 -07:00
parent e5afd605c8
commit dee31bf52f
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -107,8 +107,6 @@ function print3(s,y,w)
end
function cyclenum(n,low,up)
low=low or 1
up=up or low+1
return(n-low)%(up-low+1)+low
end
@ -1263,7 +1261,8 @@ function init_menu()
bg.set("falling")
gstate=1
gamev,mode,slc={sprite={}},mode or 1,1
gamev,mode,slc={sprite={}},mode or dget(63),1
if (mode<1) mode=1
options=options or {
gamev={},
@ -1365,21 +1364,22 @@ function update_menu()
sfx"12"
end
--start game
if 1==slc then
if slc <= 2 then
if confirm()then
dset(63,mode)
cpt(modes[modes.list[mode]],gamev)
init_game(gamev)
end
--mode selection
elseif 2==slc then
if btnp"0"then
sfx"13"
mode-=1
if(0==mode)mode=#modes.list
elseif btnp"1"then
sfx"13"
mode%=#modes.list
mode+=1
if slc == 2 then
if btnp"0"then
sfx"13"
mode-=1
if(0==mode)mode=#modes.list
elseif btnp"1"then
sfx"13"
mode%=#modes.list
mode+=1
end
end
--option menu
elseif 3==slc and confirm()then