Compare commits
12 Commits
trans_prid
...
e69ae6f37e
Author | SHA1 | Date | |
---|---|---|---|
e69ae6f37e
|
|||
38bac54ff0
|
|||
1529548d61
|
|||
873722b1ac
|
|||
db7ce90182
|
|||
ebf8c3921e
|
|||
033a71d767
|
|||
ff60db72ad
|
|||
ef59dc3f6a
|
|||
d5647a0328
|
|||
a659679b6b
|
|||
cc4b6bffd3
|
355
vacation.p8
355
vacation.p8
@ -244,16 +244,43 @@ function _init()
|
|||||||
-- complex fill API mode
|
-- complex fill API mode
|
||||||
poke(0x5f34, 1)
|
poke(0x5f34, 1)
|
||||||
|
|
||||||
font_dogica()
|
awakener_hold_frames = 0
|
||||||
mainview = newtitle()
|
mainview = ao_splash.new()
|
||||||
end
|
end
|
||||||
|
|
||||||
function _update60()
|
function _update60()
|
||||||
|
if awakener_armed then
|
||||||
|
if btn() & 0x30 > 0 then
|
||||||
|
awakener_hold_frames += 1
|
||||||
|
else
|
||||||
|
awakener_hold_frames = 0
|
||||||
|
end
|
||||||
|
if awakener_hold_frames == 90 then
|
||||||
|
exit_dither = ditherer.new{di=1}
|
||||||
|
awakener_armed = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if exit_dither and exit_dither:update() then
|
||||||
|
exit_dither = nil
|
||||||
|
awakener_hold_frames=0
|
||||||
|
mainview = fast_awakener.new()
|
||||||
|
end
|
||||||
mainview:update()
|
mainview:update()
|
||||||
end
|
end
|
||||||
|
|
||||||
function _draw()
|
function _draw()
|
||||||
mainview:draw()
|
mainview:draw()
|
||||||
|
if awakener_hold_frames >= 30 then
|
||||||
|
local gpx=(awakener_hold_frames-30) * 2 + 7
|
||||||
|
rectfill(0,0,gpx,9,4)
|
||||||
|
rectfill(gpx+1,0,128,9,5)
|
||||||
|
font_default()
|
||||||
|
print("keep holding for awakener", 1, 1, 7)
|
||||||
|
font_special()
|
||||||
|
end
|
||||||
|
if exit_dither then
|
||||||
|
exit_dither:draw()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function font_dogica()
|
function font_dogica()
|
||||||
@ -270,23 +297,35 @@ function font_default()
|
|||||||
poke(0x5f58, 0x80)
|
poke(0x5f58, 0x80)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function font_special()
|
||||||
|
poke(0x5f58, 0x81)
|
||||||
|
end
|
||||||
|
|
||||||
-->8
|
-->8
|
||||||
-- text rendering
|
-- text rendering
|
||||||
|
|
||||||
-- text colors for zonk mode:
|
-- text colors for zonk mode:
|
||||||
-- 8 -- standard
|
|
||||||
-- 9 -- delayed fade
|
|
||||||
-- 10 -- currently fading in
|
|
||||||
txtbox = {
|
txtbox = {
|
||||||
x=0,
|
x=0,
|
||||||
y=0,
|
y=0,
|
||||||
text="???",
|
f=0,
|
||||||
col=8,
|
interval=4,
|
||||||
mode=0x81,
|
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()
|
function txtbox:draw()
|
||||||
poke(0x5f58, self.mode)
|
poke(0x5f58, self.mode)
|
||||||
@ -380,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
|
||||||
|
|
||||||
@ -396,7 +478,8 @@ mknew(ditherer, function(x)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
function ditherer:update()
|
function ditherer:update()
|
||||||
self.i += self.di
|
if (self.i > 0 and self.di < 0) self.i += self.di
|
||||||
|
if (self.i < #self.pattern + 1 and self.di > 0) self.i += self.di
|
||||||
return self.i < 0 or self.i >= #self.pattern + 1
|
return self.i < 0 or self.i >= #self.pattern + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -417,8 +500,8 @@ mknew(fuzzy, function(x)
|
|||||||
local p = (x.p or fuzzy.p) & 0xffff
|
local p = (x.p or fuzzy.p) & 0xffff
|
||||||
x.mass = 0
|
x.mass = 0
|
||||||
while p ~= 0 do
|
while p ~= 0 do
|
||||||
x.mass += p & 0x8000
|
x.mass += p & 1
|
||||||
p = p << 1
|
p = (p >>> 1) & 0xffff
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -427,7 +510,7 @@ function fuzzy:update()
|
|||||||
if (self.n < self.interval) return
|
if (self.n < self.interval) return
|
||||||
self.n = 0
|
self.n = 0
|
||||||
for i=1,self.tries do
|
for i=1,self.tries do
|
||||||
local b = 1 << rnd(15)
|
local b = 1 << rnd(16)
|
||||||
if b & self.p == 0 then
|
if b & self.p == 0 then
|
||||||
if i == self.tries or not self.weight or self.mass <= self.weight then
|
if i == self.tries or not self.weight or self.mass <= self.weight then
|
||||||
self.mass += 1
|
self.mass += 1
|
||||||
@ -455,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{
|
||||||
@ -482,13 +565,223 @@ function fuzzy_stripey:draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--@musurca & @felice
|
||||||
|
function cminskycirc(r,c)
|
||||||
|
local j,k,rat=r,0,1/r
|
||||||
|
poke(0x5f25,c) --set color
|
||||||
|
for i=1,r*0.785 do
|
||||||
|
k-=rat*j
|
||||||
|
j+=rat*k
|
||||||
|
pset(63.5+j,63.5+k)
|
||||||
|
pset(63.5+j,63.5-k)
|
||||||
|
pset(63.5-j,63.5+k)
|
||||||
|
pset(63.5-j,63.5-k)
|
||||||
|
pset(63.5+k,63.5+j)
|
||||||
|
pset(63.5+k,63.5-j)
|
||||||
|
pset(63.5-k,63.5+j)
|
||||||
|
pset(63.5-k,63.5-j)
|
||||||
|
end
|
||||||
|
pset(63.5,63.5-r)
|
||||||
|
pset(63.5,63.5+r)
|
||||||
|
pset(63.5-r,63.5)
|
||||||
|
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 = obvious_breather,
|
||||||
|
sep = 8,
|
||||||
|
speed=240,
|
||||||
|
f=0,
|
||||||
|
}
|
||||||
|
mknew(breather)
|
||||||
|
|
||||||
|
function breather:update()
|
||||||
|
if (self.freeze) return
|
||||||
|
local f = self.f + 1
|
||||||
|
if (not self.on) f = 0
|
||||||
|
if (f >= self.speed) f = -self.speed
|
||||||
|
if f == 0 and self.nextspeed then
|
||||||
|
self.speed = self.nextspeed
|
||||||
|
self.nextspeed = nil
|
||||||
|
end
|
||||||
|
self.f = f
|
||||||
|
end
|
||||||
|
|
||||||
|
function easeinout(t)
|
||||||
|
if(t<.5) then
|
||||||
|
return t*t*t*4
|
||||||
|
else
|
||||||
|
t-=1
|
||||||
|
return 1-t*t*t*-4
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function breather:draw()
|
||||||
|
fillp(0)
|
||||||
|
local cols, f, spd, sep = self.colors, self.f, self.speed, self.sep
|
||||||
|
local stall = sep * (#cols - 1)
|
||||||
|
local cap = spd-stall
|
||||||
|
if (f >= 0) f += stall
|
||||||
|
for i,c in ipairs(cols) do
|
||||||
|
local ef = f - (i-1)*sep
|
||||||
|
ef = abs(ef) - stall
|
||||||
|
if ef <= cap and ef > 0 then
|
||||||
|
cminskycirc(easeinout(ef/cap)<<6,c)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
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
|
-->8
|
||||||
-- awakener
|
-- awakener
|
||||||
|
|
||||||
|
fast_awakener = {}
|
||||||
|
mknew(fast_awakener)
|
||||||
|
|
||||||
|
function fast_awakener:update()
|
||||||
|
--todo: implement
|
||||||
|
end
|
||||||
|
|
||||||
|
function fast_awakener:draw()
|
||||||
|
cls()
|
||||||
|
pal()
|
||||||
|
clear_alt_pal_bits()
|
||||||
|
font_default()
|
||||||
|
print("placeholder", 45, 61, 8)
|
||||||
|
end
|
||||||
|
|
||||||
-->8
|
-->8
|
||||||
-- consent screens
|
-- consent screens
|
||||||
|
|
||||||
|
ao_splash = {
|
||||||
|
fwait = 180,
|
||||||
|
}
|
||||||
|
mknew(ao_splash, function(self)
|
||||||
|
self.c = breather.new{
|
||||||
|
colors={7,15,14,8,2},
|
||||||
|
sep=3,
|
||||||
|
f=15,
|
||||||
|
on=true,
|
||||||
|
}
|
||||||
|
font_dogica()
|
||||||
|
end)
|
||||||
|
|
||||||
|
function ao_splash:update()
|
||||||
|
if self.c.f < self.c.speed/2.5 then
|
||||||
|
self.c:update()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self.fwait -= 1
|
||||||
|
if (self.fwait < ao_splash.fwait-30 and (btnp() & 0xf > 0) and self.fwait > 0) self.fwait = 0
|
||||||
|
if self.fwait == 0 then
|
||||||
|
self.d = ditherer.new{di=1}
|
||||||
|
end
|
||||||
|
if (self.d) self.d:update()
|
||||||
|
if self.fwait <= -32 then
|
||||||
|
-- TODO: consent screen
|
||||||
|
mainview=consent_splash.new()
|
||||||
|
mainview:update()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ao_splash:draw()
|
||||||
|
cls()
|
||||||
|
self.c:draw()
|
||||||
|
if self.fwait < ao_splash.fwait then
|
||||||
|
print("18+", 55, 60, 7)
|
||||||
|
print("aDULTS ONLY", 35, 90, 15)
|
||||||
|
end
|
||||||
|
if (self.d) self.d:draw()
|
||||||
|
end
|
||||||
|
|
||||||
|
consent_splash = {
|
||||||
|
f = 0,
|
||||||
|
}
|
||||||
|
mknew(consent_splash, function(self)
|
||||||
|
self.d = ditherer.new{
|
||||||
|
di=-1
|
||||||
|
}
|
||||||
|
awakener_armed = true
|
||||||
|
awakener_hold_frames = 0
|
||||||
|
end)
|
||||||
|
|
||||||
|
function consent_splash:update()
|
||||||
|
if (self.f < 0x7fff) self.f += 1
|
||||||
|
if (btnp(1) and self.f > 150) self.d.di = 1
|
||||||
|
if self.d:update() and self.d.di > 0 then
|
||||||
|
mainview=newtitle()
|
||||||
|
mainview:update()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function consent_splash:draw()
|
||||||
|
cls()
|
||||||
|
font_special()
|
||||||
|
print("\^w\^twarning", 20, 2, 10)
|
||||||
|
font_default()
|
||||||
|
cursor(1, 25)
|
||||||
|
color(6)
|
||||||
|
print("this game will \fchypnotize\f6 you.")
|
||||||
|
if (self.f < 45) return
|
||||||
|
print("")
|
||||||
|
print("hypnotic suggstions include:")
|
||||||
|
print("relaxation, trance, obedience,")
|
||||||
|
print("loss of volition, euphoria, joy,")
|
||||||
|
print("amnesia, identity loss, and the")
|
||||||
|
print("experience of \fetranformation")
|
||||||
|
print("into a pooltoy orca.\f6")
|
||||||
|
if (self.f < 90) return
|
||||||
|
print("")
|
||||||
|
print("an awakener that removes all")
|
||||||
|
print("suggestions is available at")
|
||||||
|
print("\faany time:\f6 hold ❎ or 🅾️.")
|
||||||
|
print("gameplay uses only arrows.")
|
||||||
|
if(self.f < 300) return
|
||||||
|
print("")
|
||||||
|
print("")
|
||||||
|
print(" consent and begin: \f7➡️")
|
||||||
|
self.d:draw()
|
||||||
|
end
|
||||||
|
|
||||||
-->8
|
-->8
|
||||||
-- title screen
|
-- title screen
|
||||||
|
|
||||||
@ -513,7 +806,7 @@ end
|
|||||||
|
|
||||||
function title_screen:draw()
|
function title_screen:draw()
|
||||||
pal()
|
pal()
|
||||||
memset(0x5f78,0x0,8)
|
clear_alt_pal_bits()
|
||||||
cls(12)
|
cls(12)
|
||||||
print("title screen", 30, 57, 0)
|
print("title screen", 30, 57, 0)
|
||||||
print("press right arrow", 15, 66, 0)
|
print("press right arrow", 15, 66, 0)
|
||||||
@ -521,8 +814,8 @@ function title_screen:draw()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function title_screen:update()
|
function title_screen:update()
|
||||||
self.d:update()
|
if (btnp(1)) self.d.di = 1
|
||||||
if (btnp(1)) start_game()
|
if(self.d:update() and self.d.di > 0) start_game()
|
||||||
end
|
end
|
||||||
-->8
|
-->8
|
||||||
-- dolphin sprite renderer
|
-- dolphin sprite renderer
|
||||||
@ -720,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,
|
||||||
@ -757,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)
|
||||||
@ -818,6 +1109,10 @@ function wave(toff)
|
|||||||
return 2.5 * sin((t()+toff)>>1)
|
return 2.5 * sin((t()+toff)>>1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function clear_alt_pal_bits()
|
||||||
|
memset(0x5f70,0x0,16)
|
||||||
|
end
|
||||||
|
|
||||||
sea = {}
|
sea = {}
|
||||||
mknew(sea)
|
mknew(sea)
|
||||||
|
|
||||||
@ -1013,17 +1308,15 @@ end
|
|||||||
|
|
||||||
function start_game()
|
function start_game()
|
||||||
seq = sequencer.new{
|
seq = sequencer.new{
|
||||||
|
-- {
|
||||||
|
-- f = arcade_level.new,
|
||||||
|
-- params = {{
|
||||||
|
-- max_score=2,
|
||||||
|
-- }}
|
||||||
|
-- },
|
||||||
{
|
{
|
||||||
f = arcade_level.new,
|
f = zonk_mode.new,
|
||||||
params = {{
|
params={},
|
||||||
max_score=2,
|
|
||||||
}}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
f = function()
|
|
||||||
pal()
|
|
||||||
return view.of{bg.new(), fuzzy_stripey.new{interval=7}}
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
seq:next()
|
seq:next()
|
||||||
|
Reference in New Issue
Block a user