intro restored

This commit is contained in:
James Turk 2023-04-08 23:29:56 -05:00
parent 5cc1cbc66a
commit 134d1f426e

View File

@ -2,17 +2,33 @@ pico-8 cartridge // http://www.pico-8.com
version 41 version 41
__lua__ __lua__
state = "ampm"
function _draw() function _draw()
cls() cls()
--ampm_draw() if state == "ampm" then
ampm_draw()
elseif state == "level" then
level_draw() level_draw()
elseif state == "gameover" then
gameover_draw()
end
end end
function _update() function _update()
--ampm_upd() if state == "ampm" then
ampm_upd()
toomgis_upd()
elseif state == "level" then
toomgis_upd() toomgis_upd()
--level_draw()
level_upd() level_upd()
elseif state == "gameover" then
gameover_upd()
end
end
function _init()
ampm_init()
end end
function sprm(n, x, y, w, h) function sprm(n, x, y, w, h)
@ -25,6 +41,15 @@ end
ampm_t = 0 ampm_t = 0
function ampm_init()
for i=2, 14 do
add2body(i)
add2body(i)
add2body(i)
add2body(i)
end
end
function ampm_draw() function ampm_draw()
local tx = 1000 local tx = 1000
local fx = 78 local fx = 78
@ -62,16 +87,16 @@ function ampm_draw()
fx, 90, 12) fx, 90, 12)
print("toomgis", fx, 100, 12) print("toomgis", fx, 100, 12)
end end
end end
function ampm_upd() function ampm_upd()
ampm_t += 1 ampm_t += 1
if ampm_t > 500 then if ampm_t > 500 then
start_level(1)
ampm_t = 0 ampm_t = 0
end end
tangle -= 0.02
end end
-->8 -->8
@ -108,15 +133,6 @@ function hitbody()
end end
end end
function full()
for i=2, 14 do
add2body(i)
add2body(i)
add2body(i)
end
end
function toomgis_draw(x, y) function toomgis_draw(x, y)
--printh(x..","..y) --printh(x..","..y)
for i=1,#tbody do for i=1,#tbody do
@ -170,20 +186,31 @@ levels = {
unit="M", unit="M",
}, },
} }
lvl = levels[1]
lvl_start_time = 1
horizon = 64 horizon = 64
items = {
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
}
function start_level(n)
state = "level"
-- toomgis reset
tbody = {}
pieces = 1
-- level reset
lvl = levels[n]
lvl_start_time = time()
items = {
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
{x=0, y=0, n=0},
}
end
function level_draw() function level_draw()
-- background -- background