balancing
This commit is contained in:
parent
8936be9402
commit
2e47d3e7a1
87
toomgis.p8
87
toomgis.p8
@ -14,7 +14,7 @@ function _draw()
|
||||
elseif state == "level" then
|
||||
level_draw()
|
||||
-- DEBUG
|
||||
print(px, 0, 120, 7)
|
||||
-- print("px="..px.." vx="..vx, 0, 120, 7)
|
||||
elseif state == "gameover" then
|
||||
gameover_draw()
|
||||
elseif state == "winscreen" then
|
||||
@ -172,15 +172,11 @@ end
|
||||
|
||||
function toomgis_upd()
|
||||
tangle += vx * 0.01
|
||||
-- throttle controls half, normal, double speed keep lower bound, not upper
|
||||
px += max(vx * throttle, min_speed)
|
||||
px += max(vx, min_speed)
|
||||
py = max(0, py+vy)
|
||||
if px < 2000 then
|
||||
px = 2000
|
||||
end -- DEBUG
|
||||
if px >= 10000 then
|
||||
px = 0
|
||||
reset_items()
|
||||
reset_items(5)
|
||||
end
|
||||
vy += yacc
|
||||
|
||||
@ -205,31 +201,31 @@ levels = {
|
||||
{
|
||||
mapy=1,
|
||||
maph=4,
|
||||
bad_item_ratio=0.08,
|
||||
bad_item_ratio=0.07,
|
||||
unit="CM",
|
||||
time=120,
|
||||
time=180,
|
||||
next=2,
|
||||
},
|
||||
{
|
||||
mapy=5,
|
||||
maph=4,
|
||||
bad_item_ratio=0.12,
|
||||
bad_item_ratio=0.10,
|
||||
unit="M",
|
||||
time=90,
|
||||
time=180,
|
||||
next=3,
|
||||
},
|
||||
{
|
||||
mapy=9,
|
||||
maph=6,
|
||||
bad_item_ratio=0.18,
|
||||
bad_item_ratio=0.15,
|
||||
unit="KM",
|
||||
time=120,
|
||||
time=180,
|
||||
next=nil,
|
||||
}
|
||||
}
|
||||
horizon = 64
|
||||
min_speed = 1
|
||||
max_speed = 4
|
||||
max_speed = 5
|
||||
throttle = 1
|
||||
|
||||
|
||||
@ -242,14 +238,13 @@ function start_level(n)
|
||||
py = 0
|
||||
vx = min_speed
|
||||
vy = 0
|
||||
throttle = 0
|
||||
yacc = 0
|
||||
streak = 0
|
||||
warnings = 0
|
||||
-- level reset
|
||||
lvl = levels[n]
|
||||
lvl_end_time = time() + lvl.time
|
||||
reset_items()
|
||||
reset_items(5)
|
||||
-- initial items on screen
|
||||
for item in all(items) do
|
||||
-- all good
|
||||
@ -259,9 +254,9 @@ function start_level(n)
|
||||
end
|
||||
end
|
||||
|
||||
function reset_items()
|
||||
function reset_items(n)
|
||||
items = {}
|
||||
for i=0,5 do
|
||||
for i=0,n do
|
||||
add(items, {x=0, y=0, n=0})
|
||||
end
|
||||
end
|
||||
@ -282,19 +277,23 @@ function fancy_background()
|
||||
line(cx1+x, cy+y, cx2+x, cy-y, 9)
|
||||
end
|
||||
|
||||
if px < 3000 then
|
||||
print("behold... my true form is unknowable", 0, 50, 9)
|
||||
elseif px < 4000 then
|
||||
print("you have OUR attention", 10, 50, 9)
|
||||
elseif px < 5000 then
|
||||
print("finish your meal", 10, 50, 9)
|
||||
elseif px < 6000 then
|
||||
print("and then i will show you", 10, 50, 9)
|
||||
elseif px < 7000 then
|
||||
print("entire worlds", 40, 50, 9)
|
||||
elseif px < 8000 then
|
||||
print("in need of...", 40, 50, 9)
|
||||
elseif px < 9000 then
|
||||
if #tbody < 50 then
|
||||
elseif #tbody < 70 then
|
||||
print("OK toomgis", 40, 70, 9)
|
||||
elseif #tbody < 80 then
|
||||
print("YOU HAVE our ATTENTION", 10, 70, 9)
|
||||
elseif #tbody < 100 then
|
||||
print("finish your snack", 30, 70, 9)
|
||||
if #items < 10 then
|
||||
reset_items(20)
|
||||
lvl.bad_item_ratio = 0
|
||||
GOAL = 200
|
||||
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
|
||||
|
||||
@ -315,7 +314,7 @@ function level_bg(unit)
|
||||
end
|
||||
else
|
||||
cls(0)
|
||||
if px < 2000 then
|
||||
if px < 2500 then
|
||||
cls(1)
|
||||
else
|
||||
fancy_background()
|
||||
@ -443,18 +442,13 @@ function level_upd()
|
||||
vy = 0
|
||||
end
|
||||
|
||||
if btn(⬅️) then
|
||||
throttle = 0.5
|
||||
elseif btn(➡️) then
|
||||
throttle = 2
|
||||
else
|
||||
throttle = 1
|
||||
if btn(➡️) then
|
||||
vx = min(vx + 0.01, max_speed)
|
||||
end
|
||||
|
||||
if btnp(⬆️) then
|
||||
-- DEBUG
|
||||
start_level(lvl.next)
|
||||
end
|
||||
end -- DEBUG
|
||||
|
||||
-- guitar
|
||||
local guitar_elapsed = time() - last_guitar
|
||||
@ -464,7 +458,7 @@ function level_upd()
|
||||
sfx(rnd({14,15,16}))
|
||||
do_guitar_reset = true
|
||||
elseif (guitar_elapsed > GUITAR_DELAY) and do_guitar_reset then
|
||||
reset_items()
|
||||
reset_items(5)
|
||||
do_guitar_reset = false
|
||||
end
|
||||
|
||||
@ -482,9 +476,6 @@ function level_upd()
|
||||
hitbody()
|
||||
streak = 0
|
||||
vx = max(vx - 1, min_speed)
|
||||
if vx < min_speed then
|
||||
vx = min_speed
|
||||
end
|
||||
else
|
||||
local mult = streak2mult()
|
||||
sfx(6, 0, 0, 4*mult)
|
||||
@ -651,12 +642,12 @@ function explainer_draw()
|
||||
draw_stink(ix, iy)
|
||||
end
|
||||
|
||||
toomgis_draw(50, 50)
|
||||
spr(33, 50, 60, 2, 2)
|
||||
toomgis_draw(50, 42)
|
||||
spr(33, 50, 50, 2, 2)
|
||||
|
||||
print("stinky makes toomgis upset", 7, 120, 9)
|
||||
print("❎ jump\ngrab/dodge\n", 5, 50)
|
||||
print("🅾️ shred\nclear screen\n", 70, 50)
|
||||
print("❎ jump\n➡️ accel\n🅾️ shred", 5, 52)
|
||||
print(" grow 100X\n to clear\n 200X to skip", 70, 52)
|
||||
end
|
||||
|
||||
function explainer_upd()
|
||||
|
Loading…
Reference in New Issue
Block a user