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