Compare commits

..

2 Commits

Author SHA1 Message Date
e69ae6f37e
zonk palettes, text sproing
not sure why breather isn't rendering
2024-02-10 17:23:17 -08:00
38bac54ff0
add color fade to text box, default to intended semantic text palette 2024-02-10 16:10:34 -08:00

View File

@ -305,19 +305,27 @@ end
-- text rendering
-- text colors for zonk mode:
-- 8 -- standard
-- 9 -- delayed fade
-- 10 -- currently fading in
txtbox = {
x=0,
y=0,
text="???",
col=8,
f=0,
interval=4,
mode=0x81,
}
mknew(txtbox)
mknew(txtbox, function(self)
if (not self.cols) self.cols = {14,10,9,8}
self.c = deli(self.cols)
end)
function txtbox:update() end
function txtbox:update()
if #self.cols > 0 then
self.f += 1
if self.f >= self.interval then
self.f = 0
self.col = deli(self.cols)
end
end
end
function txtbox:draw()
poke(0x5f58, self.mode)
@ -411,6 +419,49 @@ function scootbox:draw()
return self.v:draw()
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
-- zonk renderer
@ -487,7 +538,7 @@ fuzzy_stripey = {
weight = 12,
spacing = 7,
gap = 32,
colors = {5, 2, 1},
colors = split"3,5,2,1",
}
mknew(fuzzy_stripey, function(f)
f.fuzz = fuzzy.new{
@ -537,8 +588,10 @@ function cminskycirc(r,c)
pset(63.5+r,63.5)
end
obvious_breather=split"2,3,4,3,2"
bg_breather=split"1,2,4,2,1"
breather = {
colors = {1,2,4,2,1},
colors = obvious_breather,
sep = 8,
speed=240,
f=0,
@ -585,6 +638,39 @@ function breather:starting_reverse()
return self.f + self.speed < self.sep * #self.colors
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
-- awakener
@ -927,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)
end
-->8 word target
-->8
-- arcade mode
wordtarget = {
x = 129,
@ -964,9 +1051,6 @@ function wordtarget:draw()
print(self.str, self.x, self.y, 0x100a)
end
-->8
-- arcade mode
-- palette use:
-- 0: shallow sea blue (1)
-- 1: black (for sprites)
@ -1231,15 +1315,8 @@ function start_game()
-- }}
-- },
{
f = function()
pal()
clear_alt_pal_bits()
return view.of{
bg.new(),
fuzzy_stripey.new{interval=7, tries=5},
breather.new{on=true},
}
end,
f = zonk_mode.new,
params={},
},
}
seq:next()