This commit is contained in:
2025-07-28 22:23:08 +02:00
parent d2ff49550a
commit 586721c5f4

307
lou.p8
View File

@@ -12,17 +12,7 @@ function _init()
menuitem(1,pauseitems[pauseindex],pauseupdate()) menuitem(1,pauseitems[pauseindex],pauseupdate())
menuitem(2,"wim's song", menuitem(2,"wim's song",
function(b) function(b)
phraselen=64 wsong()
phrases={
{n=16,l=phraselen},
{n=17,l=phraselen},
{n=18,l=phraselen},
{n=19,l=phraselen},
{n=20,l=phraselen},
{n=21,l=phraselen}
}
bgm:set(phrases)
end end
) )
cop=1 cop=1
@@ -32,6 +22,20 @@ end
function _update() function _update()
lou.age+=sincelast() lou.age+=sincelast()
if (cind==#corder+1) then
wsong()
cind+=1
sentences={
"free palestine",
"whoami?",
"look at you hacker",
"pathetic creature",
"of meat and bone"
}
elseif btnp(tonum(sub(corder,cind,cind))) then
cind+=1
end
if (btn(❎) and btn(🅾️)) cs=1 if (btn(❎) and btn(🅾️)) cs=1
if (btn(❎) and btn(🅾️) and btn(⬆️) and btn(⬇️) and btn(⬅️) and btn(➡️)) then if (btn(❎) and btn(🅾️) and btn(⬆️) and btn(⬇️) and btn(⬅️) and btn(➡️)) then
lou:reset() lou:reset()
@@ -53,10 +57,10 @@ function _draw()
-- cls() -- cls()
state[cs]:draw() state[cs]:draw()
for r in all(routines) do for r in all(routines) do
if (costatus(r)!="dead") assert(coresume(r))
if (costatus(r)!="dead") assert(coresume(r))
end end
end end
-->8 -->8
--globals --globals
@@ -67,6 +71,8 @@ fc=0 --frame counter
lcs=0 --last cs lcs=0 --last cs
maxtime=.30 --maximum time before lou fully grown maxtime=.30 --maximum time before lou fully grown
routines={} routines={}
corder="2233010145"
cind=0
--list of sprites --list of sprites
--order contains a 2d array j --order contains a 2d array j
-- with the sprite index in order -- with the sprite index in order
@@ -98,10 +104,11 @@ sprites={
gib="asdwuhvzbregtnyuiopmh●✽★🐱ˇ♪♥◆⌂웃😐?!#$%" gib="asdwuhvzbregtnyuiopmh●✽★🐱ˇ♪♥◆⌂웃😐?!#$%"
sentences={ sentences={
"hi", "hi",
"lorem",
"ipsum",
"♥♥♥", "♥♥♥",
"asdfkjasdf" "🐱✽●_●",
"⬆️⬇️⬆️⬇️",
"⬅️➡️⬅️➡️",
"🅾️❎"
} }
pauseitems={ pauseitems={
@@ -110,7 +117,7 @@ pauseitems={
} }
pauseindex=1 pauseindex=1
-->8
--functions --functions
function savedate() function savedate()
@@ -178,9 +185,7 @@ function lerp(x,y,t)
end end
function async(func) function async(func)
printh("euh")
add(routines,cocreate(func)) add(routines,cocreate(func))
printh(count(routines))
end end
function fadeout() function fadeout()
@@ -194,10 +199,12 @@ function fadeout()
yield() yield()
end end
cs=ns cs=ns
cls()
end end
function fadein() function fadein()
cls()
for i=0,32 do for i=0,32 do
fillp(▒) fillp(▒)
circfill(64,64, circfill(64,64,
@@ -208,6 +215,22 @@ function fadein()
yield() yield()
end end
end end
function wsong()
phraselen=64
phrases={
{n=16,l=phraselen},
{n=17,l=phraselen},
{n=18,l=phraselen},
{n=19,l=phraselen},
{n=20,l=phraselen},
{n=21,l=phraselen}
}
bgm:set(phrases)
return
end
-->8 -->8
--state --state
state={ state={
@@ -235,10 +258,13 @@ end
}, },
{ --3 feed { --3 feed
update=function(self) update=function(self)
feed:update()
end, end,
draw=function(self) draw=function(self)
feed:draw()
end, end,
init=function(self) init=function(self)
feed:init()
end end
}, },
{ --4 language { --4 language
@@ -296,7 +322,9 @@ lou={
end end
else else
--potential first words --potential first words
s=sentences[flr(rnd(ca)*count(sentences))+1] printh("sentence")
s=rnd(sentences)
end end
self.sentence=s self.sentence=s
return flr(rnd()*6) return flr(rnd()*6)
@@ -438,7 +466,6 @@ menu={
then then
ns=self.items[self.selected].s ns=self.items[self.selected].s
async(function() async(function()
printh("euh")
fadeout(ns) fadeout(ns)
end) end)
end end
@@ -459,7 +486,7 @@ menu={
if self.speaktimer>0 then if self.speaktimer>0 then
local sen = lou.sentence local sen = lou.sentence
print(sen, print(sen,
88, 88-(#sen*2),
27,3) 27,3)
self.speaktimer-=1 self.speaktimer-=1
else else
@@ -522,6 +549,147 @@ play={
end, end,
} }
--feed
feed={
shot={x=-1,y=-1},
baby={
x=48,
y=48,
--s=12, baby sprite
w=4,
h=4,
eyes={ -- eye sprite 11
{x=2,
y=8},
{x=24,
y=8}
},
mouth={
x=10,
y=27,
w=1.5,
h=1.5,
s=1
}
},
spew={
x=-1,
y=-1},
score=0,
target={
x=64,
y=64
},
tracks=
{
{
n=23,
l=127
},
{
n=24,
l=127
},
},
init=function(self)
cls()
self.s=rnd()
bgm:set(self.tracks)
async(function()
fadein()
end)
end,
update=function(self)
self.baby.x+=cos(time()*.2)
self.baby.y+=sin(time()*.5)
if (btn(⬆️)) self.target.y-=1
if (btn(⬇️)) self.target.y+=1
if (btn(⬅️)) self.target.x-=1
if (btn(➡️)) self.target.x+=1
if (btn(❎) and not (self.shot.x>-1 or self.shot.y>-1)) then
self:shoot()
self.shot=self.target
end
end,
thing=function(self)
async(function()
sfx(24,1)
for i=0,6 do
l=lerp(6,0,i)
sspr(80,16,8,8,
feed.spew.x-l/2,
feed.spew.y-l/2,
l,
l)
yield()
end
end)
end,
draw=function(self)
cls()
for x=4,124,8 do
for y=4,124,8 do
colorr=abs(16*sin(x/(time()*.2)+time()/8*sin(y+time()/3)))+2
pset(x,y,colorr)
end
end
b=self.baby
print("score: "..self.score,1)
if (self.score+1)%10==0 then
--thing
self.spew={x=b.mouth.x+b.x,y=b.mouth.y+b.y}
self:thing()
self.score=0
end
-- spr(b.s,b.x,b.y,b.w,b.h)
sspr(96,0,32,32,b.x-16,b.y-16,b.w*16,b.h*16)
for e in all(b.eyes) do
sspr(88,0,8,8,b.x+e.x,b.y+e.y)
end
sspr(88,0+b.mouth.s*8,8,8,b.x+b.mouth.x,b.y+b.mouth.y,b.mouth.w*8,b.mouth.h*8)
spr(10,self.target.x,self.target.y)
end,
hit=function(self)
sx,sy = self.shot.x, self.shot.y
tx,ty = self.baby.mouth.x+self.baby.x, self.baby.mouth.y+self.baby.y
if sx>tx-8 and sx<tx+8 and
sy<ty+8 and sy>ty-8 then
self.score+=1
async(function()
sfx(22,1)
feed.baby.mouth.s=2
for i=0,3 do
yield()
end
feed.baby.mouth.s=1
end)
else
sfx(23,1)
end
end,
shoot=function(self,x,y)
--shoot function
-- feed.shot={x,y}
async(function()
for i=8,0,-1 do
w=lerp(32,0,1-i/8)
wh=w/2
sspr(80,8,8,8,feed.shot.x+wh,feed.shot.y+wh,w,w)
yield()
end
if (feed:hit()) then
feed.score+=1
end
feed.shot={x=-1,y=-1}
end)
end
}
--minigames --minigames
games={ games={
@@ -583,8 +751,14 @@ games={
end, end,
draw=function(self) draw=function(self)
rectfill(0,0,127,127,12) rectfill(0,0,127,127,1)
rectfill(16,16,111,111,6) rectfill(16,16,111,111,2)
for x=20,111,8 do
for y=20,111,8 do
srand(x*y)
rectfill(x,y,x,y,rnd()*16)
end
end
spr(sprites.lou.order[1], spr(sprites.lou.order[1],
16+self.tx*8, 16+self.tx*8,
16+self.ty*8, 16+self.ty*8,
@@ -599,7 +773,7 @@ games={
fillp(░) fillp(░)
circfill(24+self.px*8, circfill(24+self.px*8,
24+self.py*8, 24+self.py*8,
20+sin(time()/2)*3,1|0x1800) 20+sin(time()/2)*3,0|0x1800)
fillp(0) fillp(0)
circfill(24+self.px*8, circfill(24+self.px*8,
24+self.py*8, 24+self.py*8,
@@ -660,35 +834,35 @@ draw=function(self)
end end
} }
__gfx__ __gfx__
00000000000000000000c0c0eccceecce7777777eceeceee00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000c0c0eccceecce7777777eceeceee00000000000000000000000000000000888008880000000000000000000000000000000000000000
000988000000000000c09c00c777777ce77777777777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 000988000000000000c09c00c777777ce77777777777777700000000000000000000000000000000800000080555550000000000000000000000000000000000
00988780000000111d0c0c00e777777cc77777777777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 00988780000000111d0c0c00e777777cc777777777777777000000000000000000000000000000008000000855cccc5000000000000000000000000000000000
008888700000003111060000e777777ee77777777777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 008888700000003111060000e777777ee77777777777777700000000000000000000000000000000000000005ccccc5000000000000007777777000000000000
008888800000005555600000e777777ce77777777777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 008888800000005555600000e777777ce77777777777777700000000000000000000000000000000000000005ccccc5000000000000777777777770000000000
008998800000005555600000c777777cc77777777777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 008998800000005555600000c777777cc77777777777777700000000000000000000000000000000800000085cc5c55000000000007777777777777000000000
00969990000011111d110000c777777ce77777777777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 00969990000011111d110000c777777ce77777777777777700000000000000000000000000000000800000080550550000000000077777777777777600000000
000999000000191111110000eeceeceee77777777777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 000999000000191111110000eeceeceee77777777777777700000000000000000000000000000000888008880000000000000000077777777777777760000000
000000000000191911110000000000007777777e7777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000191911110000000000007777777e7777777700000000000000000000000000000000000000000000000000000000777777777777777777000000
00000000000019d191110000000000007777777c7777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000019d191110000000000007777777c7777777700000000000000000000000000000000009070000000000000000000777777777777777767600000
006666000000111d19110000000000007777777c7777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 006666000000111d19110000000000007777777c7777777700000000000000000000000000000000049997000000000000000007766777777777777777600000
006e6e0000004161d1110000000000007777777e7777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 006e6e0000004161d1110000000000007777777e777777770000000000000000000000000000000049a9999000eeee0000000077777777777777777777700000
00666600000001111e000000000000007777777e7777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 00666600000001111e000000000000007777777e777777770000000000000000000000000000000099994a000222222000000077776667777776666677700000
009cc0000000001111000000000000007777777e7777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 009cc0000000001111000000000000007777777e77777777000000000000000000000000000000000a9939000000000000000077666666777766666666760000
0099c0000000001111000000000000007777777c7777777700000000000000000000000000000000000000000000000000000000000000000000000000000000 0099c0000000001111000000000000007777777c7777777700000000000000000000000000000000000903000000000000000067666666776666666667770000
00aa99000000000000000000000000007777777eeeeececc00000000000000000000000000000000000000000000000000000000000000000000000000000000 00aa99000000000000000000000000007777777eeeeececc00000000000000000000000000000000000000000000000000000077666666777666666677770000
1111cccc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 1111cccc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077777777777667777777770000
1111cccc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 1111cccc00000000000000000000000000000000000000000000000000000000000000000000000000b07000000eee0000000077777777777667777777770000
1111cccc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 1111cccc0000000000000000000000000000000000000000000000000000000000000000000000000abbb70000e888e000000077777777777667777777700000
1111cccc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 1111cccc0000000000000000000000000000000000000000000000000000000000000000000000008babbbb0028888e000000077777776777666777777700000
cccc1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 cccc1111000000000000000000000000000000000000000000000000000000000000000000000000bbbb8a000288e8e000000077777776666666777777700000
cccc1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 cccc11110000000000000000000000000000000000000000000000000000000000000000000000000abb3900028888e000000077766666666666666677700000
cccc1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 cccc1111000000000000000000000000000000000000000000000000000000000000000000000000000b03000222220000000076766667777776666677700000
cccc1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 cccc1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077766677777777666777000000
00000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000007776677777777667777000000
00000000000000000000000000000000000000000000000000000000000000000066666666600000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000066666666600000000000000000000000000007776777777777777777000000
00000000000000000000000000000000000000000000000000000000000000000666666666666000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000666666666666000000000000000000000000000677777777777677760000000
00000000000000000000000000000000000000000000000000000000000000066666666666666660000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000066666666666666660000000000000000000000000067777777777777600000000
00000000000000000000000000000000000000000000000000000000000006666666666666666666660000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000006666666666666666666660000000000000000000000006777777766666000000000
00000000000000000000000000000000000000000000000000000000666655555555556655566666666666000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000666655555555556655566666666666000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000666665566666666566666555555566666660000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000666665566666666566666555555566666660000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000066665556666666666566666666666655666666660000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000066665556666666666566666666666655666666660000000000000000000000000000000000000
@@ -789,10 +963,10 @@ cccc1111000000000000000000000000000000000000000000000000000000000000000000000000
555555555555555555555657777777777777777777777777777777777777777777e77777777777777ee777777777777777777777777777777777777777777777 555555555555555555555657777777777777777777777777777777777777777777e77777777777777ee777777777777777777777777777777777777777777777
555555555555555555555555777777777777777777777777777777777777777777ee777eeeeee777777777777777777777777777777777777777777777777777 555555555555555555555555777777777777777777777777777777777777777777ee777eeeeee777777777777777777777777777777777777777777777777777
__map__ __map__
3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d07070707070707070707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c07070707070707070707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d07030505050505030707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c07030505050505030707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d07040707070700140707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c07040707070700140707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
3d3d3d3d3d3d363738393a3b3d3d3d3d07040707070707140707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0c0c0c0c0c0c363738393a3b0c0c0c0c07040707070707140707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
404142434445464748494a4b4c4d4e4f07040707070707140707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 404142434445464748494a4b4c4d4e4f07040707070707140707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
505152535455565758595a5b5c5d5e5f07040707070707140707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 505152535455565758595a5b5c5d5e5f07040707070707140707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
606162636465666768696a6b6c6d6e6f07040707070707140707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 606162636465666768696a6b6c6d6e6f07040707070707140707070720202020202020202007070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -844,14 +1018,19 @@ __sfx__
010800001c155001051c1550010500105001051c155001051a1550010500105001051815500105151550010500105001050b1551d1050c1551a105001052b1051c1552b1051d155001051a1051a1051c1551a105 010800001c155001051c1550010500105001051c155001051a1550010500105001051815500105151550010500105001050b1551d1050c1551a105001052b1051c1552b1051d155001051a1051a1051c1551a105
010800001c1550010500105001051a15500105171550010500105001050c155001050e1550010500105001051c155001051d1550010500105001051c155001051c1550010500105001051a155001051715500105 010800001c1550010500105001051a15500105171550010500105001050c155001050e1550010500105001051c155001051d1550010500105001051c155001051c1550010500105001051a155001051715500105
0108000000705007050c755007050e755007050070500705187550070517755007050070500705137550070515755007050070500705007050070513755007050070500705007050070511755007050070500705 0108000000705007050c755007050e755007050070500705187550070517755007050070500705137550070515755007050070500705007050070513755007050070500705007050070511755007050070500705
0004000000000381502e1502a15000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00050000000000b1500a1500b15000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0004000010150101501015011150131500e1500a1500a150091500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 b7100000023550235502355023550235502355023550235502355023550235502355023550235502355023550b3550b3550b3550b3550b3550b3550b3550b3550b3550b3550b3550b3550b3550b3550b3550b355
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 cd1000000035500355003550035500355003550035500355003550035500355003550035500355003550035500355003550035500355003550035500355003550035500355003550035500355003550035500355
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
002000000c650000000000000000000000000000000000000c650000000000000000000000000000000000000c650000000000000000000000000000000000000c65000000000000000000000000000000000000 002000000c650000000000000000000000000000000000000c650000000000000000000000000000000000000c650000000000000000000000000000000000000c65000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0b1000000265500605186240060518624006051862400605246550060518624006051862400605186240060502655006051862400605186242460518644006052465500605186240060518624006051862400000
__music__ __music__
00 01020304 00 01020304
00 05060708 00 05060708
@@ -876,4 +1055,6 @@ __music__
00 14424344 00 14424344
00 15424344 00 15424344
00 16424344 00 16424344
00 011a4322
00 051b4322