zonk palettes, text sproing

not sure why breather isn't rendering
This commit is contained in:
Kistaro Windrider 2024-02-10 17:23:17 -08:00
parent 38bac54ff0
commit e69ae6f37e
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -308,7 +308,6 @@ end
txtbox = { txtbox = {
x=0, x=0,
y=0, y=0,
cols={14, 10, 9, 8},
f=0, f=0,
interval=4, interval=4,
mode=0x81, mode=0x81,
@ -420,6 +419,49 @@ function scootbox:draw()
return self.v:draw() return self.v:draw()
end end
nrm_txt_pal = split"14,10,9,8"
sfd_txt_pal = split"15,10,9,8"
hlt_txt_pal = split"13,11,9,8"
shd_txt_pal = split"12,12,1,0"
function cparr(t)
local ret = {}
for i,x in ipairs(t) do
ret[i]=x
end
return ret
end
function zonk_txt(s, x, y, p, md, amt, frms)
md = md or 0x80
frms = frms or 0
amt = amt or 0
local itv = (frms>>2)&0x7ff
local v = view.of{
txtbox.new{
x=x+1,
y=y+1,
interval=itv,
cols=cparr(shd_txt_pal),
mode=md,
text=s,
},
txtbox.new{
x=x,
y=y,
interval=itv,
cols=cparr(p),
mode=md,
text=s,
},
}
return spring.new{
from=-amt,
frames=frms,
v=v,
}
end
-->8 -->8
-- zonk renderer -- zonk renderer
@ -496,7 +538,7 @@ fuzzy_stripey = {
weight = 12, weight = 12,
spacing = 7, spacing = 7,
gap = 32, gap = 32,
colors = {5, 2, 1}, colors = split"3,5,2,1",
} }
mknew(fuzzy_stripey, function(f) mknew(fuzzy_stripey, function(f)
f.fuzz = fuzzy.new{ f.fuzz = fuzzy.new{
@ -546,8 +588,10 @@ function cminskycirc(r,c)
pset(63.5+r,63.5) pset(63.5+r,63.5)
end end
obvious_breather=split"2,3,4,3,2"
bg_breather=split"1,2,4,2,1"
breather = { breather = {
colors = {1,2,4,2,1}, colors = obvious_breather,
sep = 8, sep = 8,
speed=240, speed=240,
f=0, f=0,
@ -594,6 +638,39 @@ function breather:starting_reverse()
return self.f + self.speed < self.sep * #self.colors return self.f + self.speed < self.sep * #self.colors
end end
def_z_pal = {
[0]=0,129,1,2,4,5,6,7,1,5,6,140,2,13,7,7
}
def_14_fade = split"0,128,129,133,141,13,6,15,135,7"
def_15_fade = split"0,128,129,133,141,13,13,6,6,15,15,136,135,7"
def_13_fade = split"0,128,129,133,141,140,140,13,13,12"
def_shd_fade = split"0,128,130,141,2"
zonk_mode = {}
mknew(zonk_mode, function(self)
self.stripes=fuzzy_stripey.new{}
self.brth=breather.new{}
-- test renderer
clear_alt_pal_bits()
pal()
pal(self.p or def_z_pal, 1)
self.brth.go = true
self.txtwnd = zonk_txt("tEXT tEST", 40, 60, nrm_txt_pal, 0x81, 32, 30)
end)
function zonk_mode:update()
self.stripes:update()
self.brth:update()
self.txtwnd:update()
end
function zonk_mode:draw()
cls(0)
self.stripes:draw()
self.brth:draw()
self.txtwnd:draw()
end
-->8 -->8
-- awakener -- awakener
@ -936,7 +1013,8 @@ 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) 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
-->8 word target -->8
-- arcade mode
wordtarget = { wordtarget = {
x = 129, x = 129,
@ -973,9 +1051,6 @@ function wordtarget:draw()
print(self.str, self.x, self.y, 0x100a) print(self.str, self.x, self.y, 0x100a)
end end
-->8
-- arcade mode
-- palette use: -- palette use:
-- 0: shallow sea blue (1) -- 0: shallow sea blue (1)
-- 1: black (for sprites) -- 1: black (for sprites)
@ -1240,15 +1315,8 @@ function start_game()
-- }} -- }}
-- }, -- },
{ {
f = function() f = zonk_mode.new,
pal() params={},
clear_alt_pal_bits()
return view.of{
bg.new(),
fuzzy_stripey.new{interval=7, tries=5},
breather.new{on=true},
}
end,
}, },
} }
seq:next() seq:next()