1.0
This commit is contained in:
parent
2e47d3e7a1
commit
ea9d213ed9
55
toomgis.p8
55
toomgis.p8
@ -141,7 +141,7 @@ end
|
|||||||
function hitbody()
|
function hitbody()
|
||||||
local ejected = 0
|
local ejected = 0
|
||||||
for piece in all(tbody) do
|
for piece in all(tbody) do
|
||||||
if rnd() < 0.2 then
|
if rnd() < 0.15 then
|
||||||
piece.ejecting = true
|
piece.ejecting = true
|
||||||
ejected += 1
|
ejected += 1
|
||||||
end
|
end
|
||||||
@ -203,7 +203,7 @@ levels = {
|
|||||||
maph=4,
|
maph=4,
|
||||||
bad_item_ratio=0.07,
|
bad_item_ratio=0.07,
|
||||||
unit="CM",
|
unit="CM",
|
||||||
time=180,
|
time=120,
|
||||||
next=2,
|
next=2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -261,6 +261,7 @@ function reset_items(n)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
max_text = 0
|
||||||
function fancy_background()
|
function fancy_background()
|
||||||
local cx1 = 20
|
local cx1 = 20
|
||||||
local cx2 = 108
|
local cx2 = 108
|
||||||
@ -270,6 +271,7 @@ function fancy_background()
|
|||||||
-- line(0, a, 128, a, 11)
|
-- line(0, a, 128, a, 11)
|
||||||
-- line(a, 0, a, 128, 11)
|
-- line(a, 0, a, 128, 11)
|
||||||
-- end
|
-- end
|
||||||
|
cls(0)
|
||||||
|
|
||||||
for i=0,8 do
|
for i=0,8 do
|
||||||
local x = 20*cos((i+t())/8)
|
local x = 20*cos((i+t())/8)
|
||||||
@ -277,26 +279,30 @@ function fancy_background()
|
|||||||
line(cx1+x, cy+y, cx2+x, cy-y, 9)
|
line(cx1+x, cy+y, cx2+x, cy-y, 9)
|
||||||
end
|
end
|
||||||
|
|
||||||
if #tbody < 50 then
|
max_text = max(max_text, #tbody)
|
||||||
elseif #tbody < 70 then
|
|
||||||
|
if max_text > 60 then
|
||||||
print("OK toomgis", 40, 70, 9)
|
print("OK toomgis", 40, 70, 9)
|
||||||
elseif #tbody < 80 then
|
end
|
||||||
print("YOU HAVE our ATTENTION", 10, 70, 9)
|
if max_text > 80 then
|
||||||
elseif #tbody < 100 then
|
print("YOU HAVE our ATTENTION", 10, 78, 9)
|
||||||
print("finish your snack", 30, 70, 9)
|
end
|
||||||
|
if max_text > 100 then
|
||||||
|
print("finish your snack", 30, 86, 9)
|
||||||
if #items < 10 then
|
if #items < 10 then
|
||||||
reset_items(20)
|
reset_items(20)
|
||||||
lvl.bad_item_ratio = 0
|
lvl.bad_item_ratio = 0
|
||||||
GOAL = 200
|
|
||||||
end
|
end
|
||||||
elseif #tbody < 120 then
|
|
||||||
print("AND THEN we WILL SHOW YOU", 10, 70, 9)
|
|
||||||
elseif #tbody < 150 then
|
|
||||||
print("entire worlds in need of...", 40, 70, 9)
|
|
||||||
elseif #tbody < 200 then
|
|
||||||
print("a fresh start", 0, 50, 9)
|
|
||||||
end
|
end
|
||||||
|
if max_text > 110 then
|
||||||
|
print("AND THEN we WILL SHOW YOU", 10, 94, 9)
|
||||||
|
end
|
||||||
|
if max_text > 130 then
|
||||||
|
print("entire worlds in need", 40, 102, 9)
|
||||||
|
end
|
||||||
|
if max_text > 150 then
|
||||||
|
print("of a fresh start", 40, 110, 9)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function level_bg(unit)
|
function level_bg(unit)
|
||||||
@ -313,17 +319,14 @@ function level_bg(unit)
|
|||||||
cls(1)
|
cls(1)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
cls(0)
|
if #tbody < 50 then
|
||||||
if px < 2500 then
|
|
||||||
cls(1)
|
cls(1)
|
||||||
else
|
else
|
||||||
fancy_background()
|
fancy_background()
|
||||||
|
return -- do not draw map anymore
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
function level_draw()
|
|
||||||
level_bg(lvl.unit)
|
|
||||||
-- each level is 4tl/32px
|
-- each level is 4tl/32px
|
||||||
--- zoom should go from 16 to 1 w/ growth
|
--- zoom should go from 16 to 1 w/ growth
|
||||||
local zoom = 16 - (15 * -sin(#tbody / MAX_PIECES / 4))
|
local zoom = 16 - (15 * -sin(#tbody / MAX_PIECES / 4))
|
||||||
@ -333,6 +336,10 @@ function level_draw()
|
|||||||
px/100, lvl.mapy+y/(8*zoom), 1/(8*zoom), 0)
|
px/100, lvl.mapy+y/(8*zoom), 1/(8*zoom), 0)
|
||||||
-- don't scale x start with zoom, since position is not dependent
|
-- don't scale x start with zoom, since position is not dependent
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function level_draw()
|
||||||
|
level_bg(lvl.unit)
|
||||||
|
|
||||||
toomgis_draw(20, 96-py)
|
toomgis_draw(20, 96-py)
|
||||||
-- percentage of way through guitar duration
|
-- percentage of way through guitar duration
|
||||||
@ -446,9 +453,9 @@ function level_upd()
|
|||||||
vx = min(vx + 0.01, max_speed)
|
vx = min(vx + 0.01, max_speed)
|
||||||
end
|
end
|
||||||
|
|
||||||
if btnp(⬆️) then
|
-- if btnp(⬆️) then
|
||||||
start_level(lvl.next)
|
-- start_level(lvl.next)
|
||||||
end -- DEBUG
|
-- end -- DEBUG
|
||||||
|
|
||||||
-- guitar
|
-- guitar
|
||||||
local guitar_elapsed = time() - last_guitar
|
local guitar_elapsed = time() - last_guitar
|
||||||
|
Loading…
Reference in New Issue
Block a user