From 93952ad87e3cd82e13013d29fee27b1846dd8dec Mon Sep 17 00:00:00 2001 From: James Turk Date: Thu, 13 Apr 2023 15:54:00 -0500 Subject: [PATCH] QOL changes --- toomgis.p8 | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/toomgis.p8 b/toomgis.p8 index e3e0204..8958557 100644 --- a/toomgis.p8 +++ b/toomgis.p8 @@ -198,14 +198,14 @@ end levels = { { mapy=1, - bad_item_ratio=0.12, + bad_item_ratio=0.08, unit="CM", time=120, next=2, }, { mapy=5, - bad_item_ratio=0.16, + bad_item_ratio=0.12, unit="M", time=90, next=3, @@ -214,11 +214,13 @@ levels = { mapy=9, bad_item_ratio=0.18, unit="KM", - time=60, + time=90, next=nil, } } horizon = 64 +min_speed = 1 +max_speed = 4 function start_level(n) @@ -228,7 +230,7 @@ function start_level(n) tbody = {} px = 0 py = 0 - vx = 0 + vx = min_speed vy = 0 yacc = 0 streak = 0 @@ -237,6 +239,13 @@ function start_level(n) lvl = levels[n] lvl_end_time = time() + lvl.time reset_items() + -- initial items on screen + for item in all(items) do + -- all good + item.n = flr(rnd(12)+2) + item.x = 30 + rnd(80) + item.y = rnd(90) + 5 + end end function reset_items() @@ -381,19 +390,6 @@ function level_upd() warnings = 2 end - - if btn(➡️) then - vx += 0.1 - end - if btn(⬅️) then - vx -= 0.05 - end - if vx < 0 then - vx = 0 - elseif vx > 4 then - vx = 4 - end - -- jump if btnp(❎) and py == 0 then yacc = 6 @@ -435,12 +431,18 @@ function level_upd() sfx(5, 0) hitbody() streak = 0 + vx = max(vx - 1, min_speed) + if vx < min_speed then + vx = min_speed + end else - sfx(6, 0, 0, 4*streak2mult()) - for i=1,streak2mult() do + local mult = streak2mult() + sfx(6, 0, 0, 4*mult) + for i=1,mult do add2body(item.n) end streak += 1 + vx = min(vx + 0.1*mult, max_speed) end item.n = 0 end @@ -455,7 +457,7 @@ function level_upd() to_check.n = flr(rnd(12)+2) end to_check.x = px + 128 + rnd(100) - to_check.y = rnd(90) + to_check.y = rnd(80) + 10 end end @@ -589,7 +591,7 @@ end function explainer_draw() cls(2) rectfill(0, 40, 128, 80, 0) - print("toomgis loves snacks", 20, 1, 9) + print("snacks make toomgis big and fast", 1, 1, 9) for n=0,14 do local ix = 10*n @@ -602,9 +604,9 @@ function explainer_draw() toomgis_draw(50, 50) spr(33, 50, 60, 2, 2) - print("toomgis hates stinky food", 7, 120, 9) - print("❎ jump\n🅾️ shred\n⬅️ move ➡️", 5, 50) - print("\"too much good\n stuff\"", 70, 55) + print("stinky makes toomgis upset", 7, 120, 9) + print("❎ jump\ngrab/dodge\n", 5, 50) + print("🅾️ shred\nclear screen\n", 70, 50) end function explainer_upd()