move sprite rendering to the correct tab; add error sprite
This commit is contained in:
parent
ae58950209
commit
6054e2d182
319
vacation.p8
319
vacation.p8
@ -230,8 +230,6 @@ function _init()
|
||||
|
||||
-- complex fill API mode
|
||||
poke(0x5f34, 1)
|
||||
-- per-line color mode
|
||||
poke(0x5f5f, 0x10)
|
||||
|
||||
mainview = newtitle()
|
||||
end
|
||||
@ -356,156 +354,6 @@ end
|
||||
-->8
|
||||
-- sprite rendering
|
||||
|
||||
-->8
|
||||
-- consent screens
|
||||
|
||||
-->8
|
||||
-- title screen
|
||||
|
||||
-- currently just loading
|
||||
-- whatever view I want to debug
|
||||
function newtitle()
|
||||
return arcade_level.new()
|
||||
end
|
||||
|
||||
-->8
|
||||
-- zonk mode
|
||||
|
||||
-->8
|
||||
-- awakener
|
||||
|
||||
-->8
|
||||
-- arcade mode
|
||||
|
||||
-- palette use:
|
||||
-- 0: shallow sea blue (1)
|
||||
-- 1: black (for sprites)
|
||||
-- 2: dolphin shading
|
||||
-- 3: azure water, maybe score display? (140)
|
||||
-- 4, 5, 6: unassigned, layer-specific
|
||||
-- 7: dolphin highlights
|
||||
-- 8, 9: unassigned, layer specific
|
||||
-- 10: word primary (yellow 10?)
|
||||
-- 11: word shadow (wood 132?)
|
||||
-- 12: dolphin eye
|
||||
-- 13: light splashy water (12), maybe sky?
|
||||
-- 14: dolphin primary color
|
||||
-- 15: highlight white (all layers)
|
||||
--
|
||||
-- dolphin colors are different
|
||||
-- between zones; correlated.
|
||||
-- wave, text, and black colors
|
||||
-- are the same between zones.
|
||||
-- other colors are for
|
||||
-- elements that only ever
|
||||
-- appear in one zone.
|
||||
--
|
||||
-- TODO: consider changing sky
|
||||
-- colors in different stages;
|
||||
-- document what colors those
|
||||
-- are (nrm_pal) if so.
|
||||
game_nrm_pal = {
|
||||
[0] = 1, 0, 2, 140, 4, 5, 6, 7, 8, 9, 10, 132, 12, 12, 14, 7
|
||||
}
|
||||
|
||||
-- undersea palette local decisions:
|
||||
-- 4: deeper sea blue (129)
|
||||
game_uw_pal = {
|
||||
[0]=1, 0, 130, 140, 129, 5, 6, 13, 8, 9, 10, 132, 131, 12, 141, 7
|
||||
}
|
||||
|
||||
function setup_arcade_pal()
|
||||
-- rows 72 and lower: sea
|
||||
memset(0x5f79,0xff,7)
|
||||
pal()
|
||||
pal(game_nrm_pal, 1)
|
||||
pal(game_uw_pal, 2)
|
||||
end
|
||||
|
||||
-- global wave amplitude clock
|
||||
-- wave per 2 seconds
|
||||
-- optional toff: offset. at
|
||||
-- toff==0 draw directly under
|
||||
-- the dolphin
|
||||
function wave(toff)
|
||||
toff = toff or 0
|
||||
return 2.5 * sin((t()+toff)>>1)
|
||||
end
|
||||
|
||||
sea = {}
|
||||
mknew(sea)
|
||||
|
||||
function sea:draw()
|
||||
local w = wave()
|
||||
rectfill(0, 72+w, 128, 80+w, 0)
|
||||
poke2(0x5f78, 0xFF00.00FF <<> w)
|
||||
rectfill(0, 81+w, 128, 89+w, 0x1040.a842)
|
||||
rectfill(0, 90+w, 128, 97+(w>>1), 0x1004.e169)
|
||||
rectfill(0, 98+(w>>1), 128, 104+(w>>2), 0x1004.a842)
|
||||
rectfill(0, 104+(w>>2), 128, 110+(w>>2), 0x1004)
|
||||
rectfill(0, 111+(w>>2), 128, 118+(w>>3), 0x1041.e169)
|
||||
rectfill(0, 119+(w>>3), 128, 124+(w>>3), 0x1041.a842)
|
||||
rectfill(0, 125+(w>>3), 128, 128, 0x1001)
|
||||
end
|
||||
|
||||
arcade_level = {
|
||||
score=0,
|
||||
maxscore=15,
|
||||
}
|
||||
mknew(arcade_level, function(x)
|
||||
x.phin = toyphin.new{splasher=x}
|
||||
-- TODO: decent looking sky and sea
|
||||
x.sky = bg.new{c=13}
|
||||
x.sea = sea.new()
|
||||
-- event list includes words
|
||||
x.e = event_list.new()
|
||||
-- TODO: score renderer
|
||||
x.t0 = t()
|
||||
|
||||
x.v = view.of{
|
||||
x.sky,
|
||||
x.sea,
|
||||
x.waves,
|
||||
x.phin,
|
||||
x.e,
|
||||
}
|
||||
|
||||
x.s = scootbox.new()
|
||||
x.s:push(x.v)
|
||||
|
||||
-- TODO: fade in level music
|
||||
end)
|
||||
|
||||
function arcade_level:update()
|
||||
-- TODO: timers, word loop,
|
||||
-- level state tracking and
|
||||
-- progression, etc.
|
||||
self.s:update()
|
||||
end
|
||||
|
||||
function arcade_level:draw()
|
||||
setup_arcade_pal()
|
||||
self.s:draw()
|
||||
end
|
||||
|
||||
function arcade_level:dive_splash(x)
|
||||
-- TODO: sfx, vfx for dive input
|
||||
end
|
||||
|
||||
function arcade_level:jump_splash(x)
|
||||
-- TODO: sfx, vfx for jump input
|
||||
end
|
||||
|
||||
function arcade_level:surfacing_splash(x, force, harder)
|
||||
-- TODO: sfx, vfx for surfacing from a dive
|
||||
end
|
||||
|
||||
function arcade_level:landing_splash(x, force, harder)
|
||||
-- TODO: sfx, vfx for landing from a jump
|
||||
end
|
||||
|
||||
|
||||
|
||||
phinstate_nrm = {
|
||||
s={4, 36, 4, 9},
|
||||
ws=3,
|
||||
@ -688,17 +536,168 @@ function toyphin:draw()
|
||||
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
|
||||
|
||||
-->8
|
||||
-- consent screens
|
||||
|
||||
-->8
|
||||
-- title screen
|
||||
|
||||
-- currently just loading
|
||||
-- whatever view I want to debug
|
||||
function newtitle()
|
||||
return arcade_level.new()
|
||||
end
|
||||
|
||||
-->8
|
||||
-- zonk mode
|
||||
|
||||
-->8
|
||||
-- awakener
|
||||
|
||||
-->8
|
||||
-- arcade mode
|
||||
|
||||
-- palette use:
|
||||
-- 0: shallow sea blue (1)
|
||||
-- 1: black (for sprites)
|
||||
-- 2: dolphin shading
|
||||
-- 3: azure water, maybe score display? (140)
|
||||
-- 4, 5, 6: unassigned, layer-specific
|
||||
-- 7: dolphin highlights
|
||||
-- 8, 9: unassigned, layer specific
|
||||
-- 10: word primary (yellow 10?)
|
||||
-- 11: word shadow (wood 132?)
|
||||
-- 12: dolphin eye
|
||||
-- 13: light splashy water (12), maybe sky?
|
||||
-- 14: dolphin primary color
|
||||
-- 15: highlight white (all layers)
|
||||
--
|
||||
-- dolphin colors are different
|
||||
-- between zones; correlated.
|
||||
-- wave, text, and black colors
|
||||
-- are the same between zones.
|
||||
-- other colors are for
|
||||
-- elements that only ever
|
||||
-- appear in one zone.
|
||||
--
|
||||
-- TODO: consider changing sky
|
||||
-- colors in different stages;
|
||||
-- document what colors those
|
||||
-- are (nrm_pal) if so.
|
||||
game_nrm_pal = {
|
||||
[0] = 1, 0, 2, 140, 4, 5, 6, 7, 8, 9, 10, 132, 12, 12, 14, 7
|
||||
}
|
||||
|
||||
-- undersea palette local decisions:
|
||||
-- 4: deeper sea blue (129)
|
||||
game_uw_pal = {
|
||||
[0]=1, 0, 130, 140, 129, 5, 6, 13, 8, 9, 10, 132, 131, 12, 141, 7
|
||||
}
|
||||
|
||||
function setup_arcade_pal()
|
||||
-- per-line color mode
|
||||
poke(0x5f5f, 0x10)
|
||||
-- rows 72 and lower: sea
|
||||
memset(0x5f79,0xff,7)
|
||||
pal()
|
||||
pal(game_nrm_pal, 1)
|
||||
pal(game_uw_pal, 2)
|
||||
end
|
||||
|
||||
-- global wave amplitude clock
|
||||
-- wave per 2 seconds
|
||||
-- optional toff: offset. at
|
||||
-- toff==0 draw directly under
|
||||
-- the dolphin
|
||||
function wave(toff)
|
||||
toff = toff or 0
|
||||
return 2.5 * sin((t()+toff)>>1)
|
||||
end
|
||||
|
||||
sea = {}
|
||||
mknew(sea)
|
||||
|
||||
function sea:draw()
|
||||
local w = wave()
|
||||
rectfill(0, 72+w, 128, 80+w, 0)
|
||||
poke2(0x5f78, 0xFF00.00FF <<> w)
|
||||
rectfill(0, 81+w, 128, 89+w, 0x1040.a842)
|
||||
rectfill(0, 90+w, 128, 97+(w>>1), 0x1004.e169)
|
||||
rectfill(0, 98+(w>>1), 128, 104+(w>>2), 0x1004.a842)
|
||||
rectfill(0, 104+(w>>2), 128, 110+(w>>2), 0x1004)
|
||||
rectfill(0, 111+(w>>2), 128, 118+(w>>3), 0x1041.e169)
|
||||
rectfill(0, 119+(w>>3), 128, 124+(w>>3), 0x1041.a842)
|
||||
rectfill(0, 125+(w>>3), 128, 128, 0x1001)
|
||||
end
|
||||
|
||||
arcade_level = {
|
||||
score=0,
|
||||
maxscore=15,
|
||||
}
|
||||
mknew(arcade_level, function(x)
|
||||
x.phin = toyphin.new{splasher=x}
|
||||
-- TODO: decent looking sky and sea
|
||||
x.sky = bg.new{c=13}
|
||||
x.sea = sea.new()
|
||||
-- event list includes words
|
||||
x.e = event_list.new()
|
||||
-- TODO: score renderer
|
||||
x.t0 = t()
|
||||
|
||||
x.v = view.of{
|
||||
x.sky,
|
||||
x.sea,
|
||||
x.waves,
|
||||
x.phin,
|
||||
x.e,
|
||||
}
|
||||
|
||||
x.s = scootbox.new()
|
||||
x.s:push(x.v)
|
||||
|
||||
-- TODO: fade in level music
|
||||
end)
|
||||
|
||||
function arcade_level:update()
|
||||
-- TODO: timers, word loop,
|
||||
-- level state tracking and
|
||||
-- progression, etc.
|
||||
self.s:update()
|
||||
end
|
||||
|
||||
function arcade_level:draw()
|
||||
setup_arcade_pal()
|
||||
self.s:draw()
|
||||
end
|
||||
|
||||
function arcade_level:dive_splash(x)
|
||||
-- TODO: sfx, vfx for dive input
|
||||
end
|
||||
|
||||
function arcade_level:jump_splash(x)
|
||||
-- TODO: sfx, vfx for jump input
|
||||
end
|
||||
|
||||
function arcade_level:surfacing_splash(x, force, harder)
|
||||
-- TODO: sfx, vfx for surfacing from a dive
|
||||
end
|
||||
|
||||
function arcade_level:landing_splash(x, force, harder)
|
||||
-- TODO: sfx, vfx for landing from a jump
|
||||
end
|
||||
|
||||
|
||||
-->8
|
||||
-- game sequencer
|
||||
__gfx__
|
||||
00000000777777777777777777777777777777777777777777777777777777777777777777777777777777777777777700000000000000000000000000000000
|
||||
00000000700000000000000000000007700000000000000000000007700000000000000770000000000000000000000700000000000000000000000000000000
|
||||
00700700700000000000000000000007700000000000000000000007700002222220000770000000000000000000000700000000000000000000000000000000
|
||||
00077000700000000000000000000007700000000000000000000007700002eeee20000770000000000000000000000700000000000000000000000000000000
|
||||
0007700070000000000000000000000770000000000000000000000770000222e220000770222200000000000000000700000000000000000000000000000000
|
||||
00700700700000000000000000000007702222022222222222222207700002eeee200007702ee222222222222222220700000000000000000000000000000000
|
||||
00000000700000000000000000000007702ee222e22e22ee22e2e2077000022222200007702e2e22e22e22ee22e2e20700000000000000000000000000000000
|
||||
00000000700000000000000000000007702e2e2e2e2e22e2e2e2e2077000022e22000007702e2e2e2e2e22e2e2e2e20700000000000000000000000000000000
|
||||
00888800777777777777777777777777777777777777777777777777777777777777777777777777777777777777777700000000000000000000000000000000
|
||||
0888e780700000000000000000000007700000000000000000000007700000000000000770000000000000000000000700000000000000000000000000000000
|
||||
88888878700000000000000000000007700000000000000000000007700002222220000770000000000000000000000700000000000000000000000000000000
|
||||
88a8a8e8700000000000000000000007700000000000000000000007700002eeee20000770000000000000000000000700000000000000000000000000000000
|
||||
888a888870000000000000000000000770000000000000000000000770000222e220000770222200000000000000000700000000000000000000000000000000
|
||||
88a8a888700000000000000000000007702222022222222222222207700002eeee200007702ee222222222222222220700000000000000000000000000000000
|
||||
08888880700000000000000000000007702ee222e22e22ee22e2e2077000022222200007702e2e22e22e22ee22e2e20700000000000000000000000000000000
|
||||
00888800700000000000000000000007702e2e2e2e2e22e2e2e2e2077000022e22000007702e2e2e2e2e22e2e2e2e20700000000000000000000000000000000
|
||||
00000000700000000000000000000007702e2e2e2e2e22ee22eee207700002e2e2200007702eee2e2e2e22ee22eee20700000000000000000000000000000000
|
||||
00000000702222022222222222222207702eee22e22ee2e222e2e207700002eeee20000770222222e22ee2e222e2e20700000000000000000000000000000000
|
||||
00000000702ee222e22e22ee22e2e207702222222222222202222207700002222220000770000022222222220222220700000000000000000000000000000000
|
||||
|
Loading…
Reference in New Issue
Block a user