This commit is contained in:
James Turk 2023-04-12 00:58:29 -05:00
parent f334e06078
commit ff0fc51bff

View File

@ -197,25 +197,29 @@ end
levels = { levels = {
{ {
name="store aisle",
sky=7, sky=7,
gnd=5, mapy=1,
mapy=2,
bad_item_ratio=0.12, bad_item_ratio=0.12,
unit="CM", unit="CM",
time=120, time=120,
next=2, next=2,
}, },
{ {
name="city nights",
sky=2, sky=2,
gnd=5,
mapy=5, mapy=5,
bad_item_ratio=0.16, bad_item_ratio=0.16,
unit="M", unit="M",
time=90, time=90,
next=nil, next=3,
}, },
{
sky=2,
mapy=9,
bad_item_ratio=0.18,
unit="KM",
time=60,
next=nil,
}
} }
horizon = 64 horizon = 64
@ -246,10 +250,6 @@ function reset_items()
end end
function level_draw() function level_draw()
-- background
--rectfill(0, 0, 128, horizon, lvl.sky)
--rectfill(0, horizon, 128, 128, lvl.gnd)
-- each level is 4tl/32px -- each level is 4tl/32px
cls(lvl.sky) cls(lvl.sky)
--- zoom should go from 16 to 1 w/ growth --- zoom should go from 16 to 1 w/ growth
@ -257,7 +257,7 @@ function level_draw()
local h=32 * zoom local h=32 * zoom
for y=0,h do for y=0,h do
tline(0, 128-h+y, 128, 128-h+y, -- screen coordinates (entire screen scanlines) 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 -- don't scale x start with zoom, since position is not dependent
end end
@ -385,7 +385,7 @@ function level_upd()
end end
if btnp(⬆️) then if btnp(⬆️) then
add2body(rnd(12)+2) start_level(lvl.next)
end end
-- guitar -- guitar