Compare commits
7 Commits
trans_prid
...
ebf8c3921e
Author | SHA1 | Date | |
---|---|---|---|
ebf8c3921e
|
|||
033a71d767
|
|||
ff60db72ad
|
|||
ef59dc3f6a
|
|||
d5647a0328
|
|||
a659679b6b
|
|||
cc4b6bffd3
|
145
vacation.p8
145
vacation.p8
@ -244,8 +244,7 @@ function _init()
|
||||
-- complex fill API mode
|
||||
poke(0x5f34, 1)
|
||||
|
||||
font_dogica()
|
||||
mainview = newtitle()
|
||||
mainview = ao_splash.new()
|
||||
end
|
||||
|
||||
function _update60()
|
||||
@ -396,7 +395,8 @@ mknew(ditherer, function(x)
|
||||
end)
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
@ -417,8 +417,8 @@ mknew(fuzzy, function(x)
|
||||
local p = (x.p or fuzzy.p) & 0xffff
|
||||
x.mass = 0
|
||||
while p ~= 0 do
|
||||
x.mass += p & 0x8000
|
||||
p = p << 1
|
||||
x.mass += p & 1
|
||||
p = (p >>> 1) & 0xffff
|
||||
end
|
||||
end)
|
||||
|
||||
@ -427,7 +427,7 @@ function fuzzy:update()
|
||||
if (self.n < self.interval) return
|
||||
self.n = 0
|
||||
for i=1,self.tries do
|
||||
local b = 1 << rnd(15)
|
||||
local b = 1 << rnd(16)
|
||||
if b & self.p == 0 then
|
||||
if i == self.tries or not self.weight or self.mass <= self.weight then
|
||||
self.mass += 1
|
||||
@ -482,6 +482,77 @@ function fuzzy_stripey:draw()
|
||||
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
|
||||
|
||||
breather = {
|
||||
colors = {1,2,4,2,1},
|
||||
sep = 5,
|
||||
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
|
||||
|
||||
-->8
|
||||
-- awakener
|
||||
|
||||
@ -489,6 +560,46 @@ end
|
||||
-->8
|
||||
-- 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=newtitle()
|
||||
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
|
||||
-->8
|
||||
-- title screen
|
||||
|
||||
@ -521,8 +632,8 @@ function title_screen:draw()
|
||||
end
|
||||
|
||||
function title_screen:update()
|
||||
self.d:update()
|
||||
if (btnp(1)) start_game()
|
||||
if (btnp(1)) self.d.di = 1
|
||||
if(self.d:update() and self.d.di > 0) start_game()
|
||||
end
|
||||
-->8
|
||||
-- dolphin sprite renderer
|
||||
@ -1017,17 +1128,21 @@ end
|
||||
|
||||
function start_game()
|
||||
seq = sequencer.new{
|
||||
{
|
||||
f = arcade_level.new,
|
||||
params = {{
|
||||
max_score=2,
|
||||
}}
|
||||
},
|
||||
-- {
|
||||
-- f = arcade_level.new,
|
||||
-- params = {{
|
||||
-- max_score=2,
|
||||
-- }}
|
||||
-- },
|
||||
{
|
||||
f = function()
|
||||
pal()
|
||||
clear_alt_pal_bits()
|
||||
return view.of{bg.new{c=6}, fuzzy_stripey.new{interval=7, colors={12, 7, 14}, weight=8}}
|
||||
return view.of{
|
||||
bg.new(),
|
||||
fuzzy_stripey.new{interval=7, tries=5},
|
||||
breather.new{on=true},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user