fix names and labels
these aren't "sprite" and "draw" palettes, they're "draw" and "screen" palettes. Fix variable names and labels.
This commit is contained in:
parent
d1e4d90c5b
commit
10f089c589
@ -11,7 +11,7 @@ function _init()
|
|||||||
poke2(0x5f70, 0xffff)
|
poke2(0x5f70, 0xffff)
|
||||||
|
|
||||||
mode = "boxes"
|
mode = "boxes"
|
||||||
active = "sprite"
|
active = "draw"
|
||||||
scx = 0
|
scx = 0
|
||||||
scy = 0
|
scy = 0
|
||||||
dcx = 0
|
dcx = 0
|
||||||
@ -52,30 +52,30 @@ end
|
|||||||
|
|
||||||
function _update()
|
function _update()
|
||||||
if (btnp(🅾️)) mode = (mode == "boxes") and "rows" or "boxes"
|
if (btnp(🅾️)) mode = (mode == "boxes") and "rows" or "boxes"
|
||||||
if (btnp(❎)) active = (active == "sprite") and "draw" or "sprite"
|
if (btnp(❎)) active = (active == "draw") and "screen" or "draw"
|
||||||
if active == "sprite" then
|
if active == "draw" then
|
||||||
if (btnp(⬆️)) scy -= 1
|
|
||||||
if (btnp(⬇️)) scy += 1
|
|
||||||
if (btnp(⬅️)) scx -= 1
|
|
||||||
if (btnp(➡️)) scx += 1
|
|
||||||
else
|
|
||||||
if (btnp(⬆️)) dcy -= 1
|
if (btnp(⬆️)) dcy -= 1
|
||||||
if (btnp(⬇️)) dcy += 1
|
if (btnp(⬇️)) dcy += 1
|
||||||
if (btnp(⬅️)) dcx -= 1
|
if (btnp(⬅️)) dcx -= 1
|
||||||
if (btnp(➡️)) dcx += 1
|
if (btnp(➡️)) dcx += 1
|
||||||
|
else
|
||||||
|
if (btnp(⬆️)) scy -= 1
|
||||||
|
if (btnp(⬇️)) scy += 1
|
||||||
|
if (btnp(⬅️)) scx -= 1
|
||||||
|
if (btnp(➡️)) scx += 1
|
||||||
end
|
end
|
||||||
scx %= (mode == "boxes") and box_cols or rows_cols
|
|
||||||
dcx %= (mode == "boxes") and box_cols or rows_cols
|
dcx %= (mode == "boxes") and box_cols or rows_cols
|
||||||
scy %= (mode == "boxes") and box_rows or rows_rows
|
scx %= (mode == "boxes") and box_cols or rows_cols
|
||||||
dcy %= (mode == "boxes") and box_rows or rows_rows
|
dcy %= (mode == "boxes") and box_rows or rows_rows
|
||||||
|
scy %= (mode == "boxes") and box_rows or rows_rows
|
||||||
end
|
end
|
||||||
|
|
||||||
function _draw()
|
function _draw()
|
||||||
cls()
|
cls()
|
||||||
draw_hud()
|
draw_hud()
|
||||||
local pals = (mode == "boxes") and box_pals or rows_pals
|
local pals = (mode == "boxes") and box_pals or rows_pals
|
||||||
pals[scx][scy]:do_both(0)
|
pals[dcx][dcy]:do_both(0)
|
||||||
pals[dcx][dcy]:do_both(1)
|
pals[scx][scy]:do_both(1)
|
||||||
draw_bars()
|
draw_bars()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -103,18 +103,18 @@ box_cols = 4
|
|||||||
function draw_box_hud()
|
function draw_box_hud()
|
||||||
spr(1,3,0,4,2)
|
spr(1,3,0,4,2)
|
||||||
local toff = time() * 4 \ 1 % 2
|
local toff = time() * 4 \ 1 % 2
|
||||||
spr(107 + (active == "sprite" and toff or 0),
|
spr(107 + (active == "draw" and toff or 0),
|
||||||
3+8*scx,4*scy,1,0.5)
|
|
||||||
spr(109 + (active == "draw" and toff or 0),
|
|
||||||
3+8*dcx,4*dcy,1,0.5)
|
3+8*dcx,4*dcy,1,0.5)
|
||||||
|
spr(109 + (active == "screen" and toff or 0),
|
||||||
|
3+8*scx,4*scy,1,0.5)
|
||||||
|
|
||||||
print_shadow("spr",42,1,12)
|
print_shadow("draw",42,1,12)
|
||||||
print_shadow(lpad(boxspr(scx,scy),3),42,9,6)
|
print_shadow(lpad(boxspr(scx,scy),3),46,9,6)
|
||||||
sspr(8+8*scx,4*scy,8,4,55,4,16,8)
|
sspr(8+8*dcx,4*dcy,8,4,59,4,16,8)
|
||||||
|
|
||||||
print_shadow("draw",73,1,14)
|
print_shadow("scr",77,1,14)
|
||||||
print_shadow(lpad(boxspr(dcx,dcy),3),77,9,6)
|
print_shadow(lpad(boxspr(dcx,dcy),3),77,9,6)
|
||||||
sspr(8+8*dcx,4*dcy,8,4,91,4,16,8)
|
sspr(8+8*scx,4*scy,8,4,91,4,16,8)
|
||||||
end
|
end
|
||||||
|
|
||||||
rows_rows = 8
|
rows_rows = 8
|
||||||
@ -124,16 +124,16 @@ function draw_rows_hud()
|
|||||||
spr(33,0,0,2,2)
|
spr(33,0,0,2,2)
|
||||||
spr(35,22,0,2,2)
|
spr(35,22,0,2,2)
|
||||||
local toff = time() * 4 \ 1 % 2
|
local toff = time() * 4 \ 1 % 2
|
||||||
spr(103 + (active == "sprite" and toff or 0),
|
spr(103 + (active == "draw" and toff or 0),
|
||||||
17 + 22*scx, 2*scy, 0.25, 0.25)
|
|
||||||
spr(105 + (active == "draw" and toff or 0),
|
|
||||||
17 + 22*dcx, 2*dcy, 0.25, 0.25)
|
17 + 22*dcx, 2*dcy, 0.25, 0.25)
|
||||||
|
spr(105 + (active == "screen" and toff or 0),
|
||||||
|
17 + 22*scx, 2*scy, 0.25, 0.25)
|
||||||
|
|
||||||
print_shadow("spr",48,0,12)
|
print_shadow("draw",44,0,12)
|
||||||
sspr(8+16*scx,16+2*scy,16,2,61,2,32,4)
|
sspr(8+16*dcx,16+2*dcy,16,2,61,1,32,4)
|
||||||
|
|
||||||
print_shadow("draw",44,8,14)
|
print_shadow("scr",48,8,14)
|
||||||
sspr(8+16*dcx,16+2*dcy,16,2,61,10,32,4)
|
sspr(8+16*scx,16+2*scy,16,2,61,9,32,4)
|
||||||
end
|
end
|
||||||
|
|
||||||
function draw_bars()
|
function draw_bars()
|
||||||
|
Loading…
Reference in New Issue
Block a user