From ff0fc51bff861325715df44d0d69d7e1fa879e80 Mon Sep 17 00:00:00 2001 From: James Turk Date: Wed, 12 Apr 2023 00:58:29 -0500 Subject: [PATCH] levels --- toomgis.p8 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/toomgis.p8 b/toomgis.p8 index 3839de8..e85d653 100644 --- a/toomgis.p8 +++ b/toomgis.p8 @@ -197,25 +197,29 @@ end levels = { { - name="store aisle", sky=7, - gnd=5, - mapy=2, + mapy=1, bad_item_ratio=0.12, unit="CM", time=120, next=2, }, { - name="city nights", sky=2, - gnd=5, mapy=5, bad_item_ratio=0.16, unit="M", time=90, - next=nil, + next=3, }, + { + sky=2, + mapy=9, + bad_item_ratio=0.18, + unit="KM", + time=60, + next=nil, + } } horizon = 64 @@ -246,10 +250,6 @@ function reset_items() end function level_draw() - -- background - --rectfill(0, 0, 128, horizon, lvl.sky) - --rectfill(0, horizon, 128, 128, lvl.gnd) - -- each level is 4tl/32px cls(lvl.sky) --- zoom should go from 16 to 1 w/ growth @@ -257,7 +257,7 @@ function level_draw() local h=32 * zoom for y=0,h do tline(0, 128-h+y, 128, 128-h+y, -- screen coordinates (entire screen scanlines) - px/80, 1+y/(8*zoom), 1/(8*zoom), 0) + px/80, lvl.mapy+y/(8*zoom), 1/(8*zoom), 0) -- don't scale x start with zoom, since position is not dependent end @@ -385,7 +385,7 @@ function level_upd() end if btnp(⬆️) then - add2body(rnd(12)+2) + start_level(lvl.next) end -- guitar