Remove unused code
This commit is contained in:
parent
a7697fa1b2
commit
7f87814d35
33
engine.lua
33
engine.lua
@ -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
|
||||
|
1
main.p8
1
main.p8
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user