diff --git a/toomgis.p8 b/toomgis.p8 index aa4358d..b05fe8a 100644 --- a/toomgis.p8 +++ b/toomgis.p8 @@ -141,7 +141,7 @@ end function hitbody() local ejected = 0 for piece in all(tbody) do - if rnd() < 0.2 then + if rnd() < 0.15 then piece.ejecting = true ejected += 1 end @@ -203,7 +203,7 @@ levels = { maph=4, bad_item_ratio=0.07, unit="CM", - time=180, + time=120, next=2, }, { @@ -261,6 +261,7 @@ function reset_items(n) end end +max_text = 0 function fancy_background() local cx1 = 20 local cx2 = 108 @@ -270,6 +271,7 @@ function fancy_background() -- line(0, a, 128, a, 11) -- line(a, 0, a, 128, 11) -- end + cls(0) for i=0,8 do local x = 20*cos((i+t())/8) @@ -277,26 +279,30 @@ function fancy_background() line(cx1+x, cy+y, cx2+x, cy-y, 9) end - if #tbody < 50 then - elseif #tbody < 70 then + max_text = max(max_text, #tbody) + + if max_text > 60 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) + end + if max_text > 80 then + print("YOU HAVE our ATTENTION", 10, 78, 9) + end + if max_text > 100 then + print("finish your snack", 30, 86, 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 - + 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 function level_bg(unit) @@ -313,17 +319,14 @@ function level_bg(unit) cls(1) end else - cls(0) - if px < 2500 then + if #tbody < 50 then cls(1) else fancy_background() + return -- do not draw map anymore end end -end -function level_draw() - level_bg(lvl.unit) -- each level is 4tl/32px --- zoom should go from 16 to 1 w/ growth 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) -- don't scale x start with zoom, since position is not dependent end +end + +function level_draw() + level_bg(lvl.unit) toomgis_draw(20, 96-py) -- percentage of way through guitar duration @@ -446,9 +453,9 @@ function level_upd() vx = min(vx + 0.01, max_speed) end - if btnp(⬆️) then - start_level(lvl.next) - end -- DEBUG + -- if btnp(⬆️) then + -- start_level(lvl.next) + -- end -- DEBUG -- guitar local guitar_elapsed = time() - last_guitar