Remove unused code

This commit is contained in:
Pyrex 2024-02-14 14:10:19 -08:00
parent a7697fa1b2
commit 7f87814d35
4 changed files with 3 additions and 59 deletions

View File

@ -32,39 +32,6 @@ function klass()
return k
end
function alives(tbl)
local tbl2={}
for i in all(tbl) do
if (not i.dead) add(tbl2,i)
end
return tbl2
end
function trunc4(x)
if (x < 0) return -trunc4(-x)
return x\0.25/4
end
function stepstep(by,x0,x1,f)
local x=x0
if (x==x1) return
if x0>x1 then
return stepstep(by,-x0,-x1,function(x) return f(-x) end)
end
x=x\by*by
while true do
x+=by
if (x>=x1) f(x1) break
if (not f(x)) break
end
end
function lerp(x,x0,x1)
return x0+x*(x1-x0)
end
function gsv(s)
local ret=split(s,"\n")
for i,v in ipairs(ret) do

View File

@ -31,7 +31,6 @@ __lua__
#include state_gameround.lua
#include state_ironman.lua
#include state_reset_menu.lua
#include state_restartmenu.lua
#include state_wonironman.lua
#include state_wonround.lua
#include tutorial.lua

View File

@ -30,8 +30,10 @@ function state_gameround:update()
local restart_progress=self.restart_frames/60
self.board:set_restart_progress(restart_progress)
if restart_progress>=1.0 then
main.state_manager:push(state_restartmenu:new())
self.outcome="restart"
self.done=true
return
end

View File

@ -1,24 +0,0 @@
state_restartmenu=klass()
function state_restartmenu:init()
end
function state_restartmenu:enter()
-- for now, make this only a restart button
self.outcome="restart" self.done=true
end
function state_restartmenu:exit(new_top)
new_top.outcome=self.outcome
new_top.done=true
end
function state_restartmenu:reenter() end
function state_restartmenu:suspend() end
function state_restartmenu:update()
if (btnp(0)) self.outcome="menu" self.done=true
if (btnp(4)) self.outcome="restart" self.done=true
end
function state_restartmenu:draw()
cls(13)
print("⬅️ back to menu",1,58,7)
print("🅾️ restart",1,64,7)
end