switch palette strategy.

more work to do - this doesn't handle undulating waves. but with dolphin physics in, the rest of the arcade screen comes tomorrow
This commit is contained in:
Kistaro Windrider 2024-02-04 01:26:45 -08:00
parent 69dab5482a
commit 1ad0e973a5
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -404,6 +404,7 @@ function newtitle()
}, },
to=64, to=64,
}) })
setup_arcade_pal()
return view.of{ return view.of{
{ {
update=function() update=function()
@ -458,7 +459,6 @@ end
-- dolphin sprite states: -- dolphin sprite states:
-- spr args -- spr args
-- draw pal
-- hitbox offset; it's always -- hitbox offset; it's always
-- some fixed size (trying to -- some fixed size (trying to
-- figure out what that size is) -- figure out what that size is)
@ -478,17 +478,25 @@ phin_uw_pal = {
[7]=135, [7]=135,
[12]=140, [12]=140,
} }
phin_err_pal = { identity = {
[2]=2, [0]=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
[7]=7,
[12]=8,
} }
function setup_arcade_pal()
-- per-line color mode
poke(0x5f5f, 0x10)
-- rows 72 and lower: sea
memset(0x5f79,0xff,7)
pal()
pal(identity, 2)
pal(phin_nrm_pal, 1)
pal(phin_uw_pal, 2)
end
phinstate_nrm = { phinstate_nrm = {
s={4, 36, 4, 9}, s={4, 36, 4, 9},
ws=3, ws=3,
hs=2, hs=2,
p=phin_nrm_pal,
idle=true, idle=true,
xo=-12, xo=-12,
yo=-8, yo=-8,
@ -497,7 +505,6 @@ phinstate_jump_full = {
s={7}, s={7},
ws=2, ws=2,
hs=3, hs=3,
p=phin_nrm_pal,
xo=-4, xo=-4,
yo=-8, yo=-8,
} }
@ -505,7 +512,6 @@ phinstate_jump_wane = {
s={1}, s={1},
ws=3, ws=3,
hs=3, hs=3,
p=phin_nrm_pal,
xo=-12, xo=-12,
yo=-8, yo=-8,
} }
@ -513,7 +519,6 @@ phinstate_crest = {
s={4}, s={4},
ws=3, ws=3,
hs=2, hs=2,
p=phin_nrm_pal,
xo=-12, xo=-12,
yo=-8, yo=-8,
} }
@ -523,7 +528,6 @@ phinstate_dive_full = {
s={7}, s={7},
ws=2, ws=2,
hs=3, hs=3,
p=phin_uw_pal,
xo=-4, xo=-4,
yo=-16, yo=-16,
} }
@ -531,7 +535,6 @@ phinstate_dive_wane = {
s={1}, s={1},
ws=3, ws=3,
hs=3, hs=3,
p=phin_uw_pal,
xo=-12, xo=-12,
yo=-16, yo=-16,
} }
@ -539,7 +542,6 @@ phinstate_return = {
s={4}, s={4},
ws=3, ws=3,
hs=2, hs=2,
p=phin_uw_pal,
xo=-12, xo=-12,
yo=-8, yo=-8,
} }
@ -550,7 +552,6 @@ phinstate_error = {
s={17}, s={17},
ws=1, ws=1,
hs=2, hs=2,
p=phin_err_pal,
} }
-- coordinates are the notional -- coordinates are the notional
@ -686,7 +687,6 @@ end
function toyphin:draw() function toyphin:draw()
local st, y = self.state, self.y local st, y = self.state, self.y
pal(st.p, 1)
if (st.idle) y += wave() if (st.idle) y += wave()
spr(st.s[1+(((t()<<1)&0x0.FFFF*#st.s)&0x7FFF)], self.x + st.xo, y + st.yo, self.state.ws, self.state.hs) spr(st.s[1+(((t()<<1)&0x0.FFFF*#st.s)&0x7FFF)], self.x + st.xo, y + st.yo, self.state.ws, self.state.hs)
end end