Tiling menu

This commit is contained in:
Pyrex 2024-02-11 16:48:11 -08:00
parent f30b7d6023
commit 172fd30ad0
5 changed files with 63 additions and 34 deletions

58
main.p8
View File

@ -74,35 +74,35 @@ __gfx__
fffffffff000000000000000000000000000000000000ff000000000000000000000000000000000000000000000000000000000000000000000000000000000
0ff0000fff00000000000000000000000000000000000ff00000000000fff0000000000000000000000000000000000000000000000000000000000000000000
0ff00000ff000ffff00ffff00fff00ffff000ff0fff00f00fffff000000fff000000000000000000000000000000000000000000000000000000000000000000
0ff0000ff000f000ff00ff0000f00f000ff0ffff00ff000ff000f00000fff0000000000000000000000000000000000000000000000000000000000000000000
0ff0fff000000000ff00ff0000f0ff000ff00ff000ff000ff0000000000000000000000000000000000000000000000000000000000000000000000000000000
0ff00ff000000fffff000ff00f00fffffff00ff000ff000ffff00000000000000000000000000000000000000000000000000000000000000000000000000000
0ff000ff0000f000ff000ff00f00ff0000000ff000ff00000ffff000000000000000000000000000000000000000000000000000000000000000000000000000
0ff0000ff00ff000ff0000f0f000ff0000000ff000ff0000000ff000000000000000000000000000000000000000000000000000000000000000000000000000
0ff00000ff0ff00fff0000fff0000ff000f00ff000ff000f000ff000000000000000000000000000000000000000000000000000000000000000000000000000
ffff0000fff0fff0fff0000f000000ffff00ffff00fff00fffff0000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
fffffffff0000000000000000000000000fff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0ff0000fff0000000000000000000000000ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0ff00000ff000ffff00000ffff00000fff0ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0ff0000ff000ff00ff000ff00ff000ff00fff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0ff0fff0000ff0000ff0ff0000ff0ff0000ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0ff00ff0000ff0000ff0ff0000ff0ff0000ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0ff000ff000ff0000ff0ff0000ff0ff0000ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0ff0000ff00ff0000ff0ff0000ff0ff0000ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0ff00000ff00ff00ff000ff00ff000ff00fff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
ffff0000fff00ffff00000ffff00000fff0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0ff0000ff000f000ff00ff0000f00f000ff0ffff00ff000ff000f00000fff0000000000000000000000000000000000000000000000000000000000770000000
0ff0fff000000000ff00ff0000f0ff000ff00ff000ff000ff0000000000000000000000000000000000000000000000000000000000000000000777700000000
0ff00ff000000fffff000ff00f00fffffff00ff000ff000ffff00000000000000000000000000000000000000000000000000000000000000777777700000000
0ff000ff0000f000ff000ff00f00ff0000000ff000ff00000ffff000000000000000000000000000000000000000000000000000000000007777777700000000
0ff0000ff00ff000ff0000f0f000ff0000000ff000ff0000000ff000000000000000000000000000000000000000000000000000000000777777777000000000
0ff00000ff0ff00fff0000fff0000ff000f00ff000ff000f000ff000000000000000000000000000000000000000000000000000000007777777700000000000
ffff0000fff0fff0fff0000f000000ffff00ffff00fff00fffff0000000000000000000000000000000000000000000000000000000077777777000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000777777770000000000000
fffffffff0000000000000000000000000fff0000000000000000000000000000000000000000000000000000000000000000000007777777700000dd0000000
0ff0000fff0000000000000000000000000ff000000000000000000000000000000000000000000000000000000000000000000000777777700000ddd0000000
0ff00000ff000ffff00000ffff00000fff0ff0000000000000000000000000000000000000000000000000000000000000000000077777770000dddddd000000
0ff0000ff000ff00ff000ff00ff000ff00fff00000000000000000000000000000000000000000000000000000000000000000000777777700ddddddd0000000
0ff0fff0000ff0000ff0ff0000ff0ff0000ff0000000000000000000000000000000000000000000000000000000000000000000777777770ddddddd00000000
0ff00ff0000ff0000ff0ff0000ff0ff0000ff0000000000000000000000000000000000000000000000000000000000000000000777777777dddddd000000000
0ff000ff000ff0000ff0ff0000ff0ff0000ff000000000000000000000000000000000000000000000000000000000000000000077777777dddddd0000000000
0ff0000ff00ff0000ff0ff0000ff0ff0000ff000000000000000000000000000000000000000000000000000000000000000000077777777ddddd00000777000
0ff00000ff00ff00ff000ff00ff000ff00fff000000000000000000000000000000000000000000000000000000000000000000077777777dddd000007777770
ffff0000fff00ffff00000ffff00000fff0fff0000000000000000000000000000000000000000000000000000000000000000077777777dddd0000077777777
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000777777dd7ddd7770777777700
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000777777d7777777777777777000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007777777777777777777777777000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000777777777777777777777777777700
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007777777777777777777770000777700
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077707777777777777777000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077777777777777777770000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077777777777777777770000700000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077770000007777777700000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077700000000077770000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000
c9311100fc009820e4509a50ca603c90a3a009a0d5b00dd055f027215d21a531e531d6319831e8317931277132a5120a007276821161320416d14631d331e862
7462511341324319b5779502eb05d82194423941818023885111644669aa2a169110a1561bb28201632467214103762f4812302241975603a9799117a3111c31
54224678216131332299517613113822a1a81b2191451b9d4a12444e2146331121146b18a623a1212143b4414461930716662c10145931ca52421046d1d46453

BIN
ravens.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -15,7 +15,7 @@ function state_excavate_menu:suspend() end
function state_excavate_menu:update()
self.frame+=1
self.progress=self.frame/self.frames
if (self.progress>1) self.done=true main.state_manager:push(state_ironman:new(tutorial))
if (self.progress>1) self.done=true main.state_manager:push(state_ironman:new(non_tutorial))
end
function state_excavate_menu:draw()
self.prior_menu:draw()

View File

@ -1,6 +1,7 @@
state_menu=klass()
function state_menu:init()
self.selection=1
self.frame=0
self.options={
menu_option:new(function() return "excavate" end,function()
main.state_manager:push(state_excavate_menu:new(self))
@ -28,6 +29,8 @@ function state_menu:suspend()
end
function state_menu:update()
self.frame+=1
self.frame%=1024
if (btnp(1) or btnp(4)) self.options[self.selection]:cb()
local vel=0
@ -42,6 +45,7 @@ function state_menu:update()
end
function state_menu:draw()
cls(13)
self:draw_bg()
local optionsh=1
for o in all(self.options) do
optionsh+=2
@ -49,6 +53,7 @@ function state_menu:draw()
end
local totalh=optionsh+32
local y=128-totalh-1--64-totalh\2
-- rectfill(68,y,126,y+totalh-1,13)
spr(64,68,y,7,3)
y+=22
line(68,y,126,y,15)
@ -79,6 +84,20 @@ function state_menu:draw()
end
end
function state_menu:draw_bg()
pal(7,1)
pal(13,1)
local m=128-(self.frame/2)%128
for col=-8,7 do
for row=-3,7 do
local realx=flr(col*32-row*16)+m
local realy=flr(row*30-col*12)
spr(76,realx,realy,4,4)
end
end
pal()
end
menu_option=klass()
function menu_option:init(name,cb)
self.name=name

View File

@ -1,3 +1,4 @@
standard_watcher_cb=function(i) return function() return watcher:new(progression[i]) end end
tutorial={
-- function() return watcher:new(progression[6]) end,
function()
@ -30,9 +31,18 @@ tutorial={
tutorial_grab:new(3,1),
})
end,
function() return watcher:new(progression[4]) end,
function() return watcher:new(progression[5]) end,
function() return watcher:new(progression[6]) end,
function() return watcher:new(progression[7]) end,
standard_watcher_cb(4),
standard_watcher_cb(5),
standard_watcher_cb(6),
standard_watcher_cb(7),
completion_stage=3
}
non_tutorial={
standard_watcher_cb(3),
standard_watcher_cb(4),
standard_watcher_cb(5),
standard_watcher_cb(6),
standard_watcher_cb(7)
}