Play game
Bouncy pico1k jam's itch.io pageCompressed Bytes used
1024
Source Code (OPTIONAL)
function _init()
score=-1
x=0
y=0
yspeed=0
bounce=10
p={
{x=0,y=0,xx=7,yy=0,ychange=0,kick=0},
{x=0,y=-8,xx=7,yy=0,ychange=-8,kick=10},
{x=0,y=8,xx=7,yy=0,ychange=8,kick=-9}
}
offset=0
yoffset=0
lastheight=0
seed=abs(stat(80)+(stat(81)*10000)+(stat(82)*1000000))
srand(seed)
r=flr(rnd(4))
squish=10
xspeed=0
xposofhit=0
tilehitindex=0
t={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
boing="\aceb"
lost="\as9gfedcba"
lt=0
end
function _update()
if y>138 then
if((lt<4))lt+=1
if lt==1 then
?(lost)
end
if btn(5) then
run()
end
else
if squish==0 then
if btn(1) then
if xspeed > 0 then
xspeed-=1
end
x+=3
end
if btn(0) then
if xspeed < 0 then
xspeed+=1
end
x-=2
end
if xspeed > 0 then
xspeed-=1
end
if xspeed < 0 then
xspeed+=1
end
yspeed+=1
y+=yspeed
x+=xspeed
else
squish-=1
end
x-=1
x=mid(4,120,x)
ground=150
tilehitindex=0
for i=y-yspeed-8,127 do
if pget(x,i)==11 then
ground=i
xposofhit=x
break
end
if pget(x-3,i)==11 then
ground=i
xposofhit=x-3
break
end
if pget(x+4,i)==11 then
ground=i
xposofhit=x+4
break
end
end
if y>ground then
y=ground-1
yspeed=-bounce
squish=4
score+=1
?(boing)
tilehitindex=ceil((xposofhit-offset)/8)
if t[tilehitindex]!=nil and t[tilehitindex]>0 then
xspeed=p[t[tilehitindex]].kick
end
end
offset-=flr(1+mid(0,2,flr(score/8)))
if offset<-7 then
r-=1
if r<0 then
r=flr(rnd(4))
choice=flr(rnd(4))
if choice==0 and t[#t]==0 or t[#t]==3 then
choice=1
r=0
end
if choice==0 and r<2 then
r+=flr(rnd(4))
end
end
if choice==2 and lastheight<127 then
choice=3
end
if choice==3 and lastheight>160-yoffset then
choice=2
end
add(t,choice)
if t[1]!=0 then
yoffset+=p[t[1]].ychange
end
deli(t,1)
offset=0
end
end
end
function _draw()
cls(0)
if squish>0 then
ovalfill(x-3,y-2,x+4,y,8)
else
if abs(yspeed)<3 then
ovalfill(x-3,y-10,x+4,y,8)
else
ovalfill(x-3,y-7,x+4,y,8)
end
end
i=0
py=120-yoffset
lastheight=120+yoffset
for k,v in pairs(t) do
i+=1
px=((i-1)*8)+offset
if v>0 then
py=py+(p[v].yy-p[v].y)
line(p[v].x+px,
p[v].y+py,
p[v].xx+px,
p[v].yy+py,
11)
if i>0 and v>0 then
lastheight+=p[v].ychange
end
end
end
color(7)
?(" today's seed "..seed.."\n score "..score.."\n ⬅️➡️ move")
if lt>0 then
?("\n\n the end ".."\n btn ❎")
end
end
Leave a comment
Log in with itch.io to leave a comment.
Comments
This is fun, nice job. I agree the bounce animation is great.
This is really cool. The gameplay has a very satisfying rhythm to it and I love the use of a daily seed.
Wow, this is a very cool (+addictive) concept.
Having the terrain affect the bounce so much that you have to learn "feel" for the game is interesting.
The bounce animation is very effective, as is the nice sound FX.
I especially love the idea of using the current day as the rng seed - I definitely wanna try using that in future! 🤓
Today, I only managed 22 - though I feel I'll be pulled back again some day 😅
Cool entry 👍
nice game, simple design, cool gameplay
Nice! Like the sound effects and the daily new seed. :)
Cool game :)
This is cool. I really like the ball animation, feels very satisfying. I like the day seed idea of a new challenge each day too! Good job.
Thanks! I really wanted the ball to feel good to control. The first iteration did not squish, but that made it hard to see where the ball landed or if it hit a slope. So despite the token cost I added in a squish delay to give the player some reaction time. The ball also stretches at the top for a little bit to help with the cartoon feedback feel.
I originally was going to ship just the red ball bouncing around. But that version was only like 300 of the 1024 bytes. So I managed to fit a whole game alongside it in the end!
There are probably ways to squish this even smaller but I liked the challenge of doing it by hand and coming up with something that compresses well. I'm not sure the source code here will preserve the formatting, so I have also uploaded the .p8 file to the game page in case you want to verify. I hit the limit exactly, just enough to allow a restart "run()" command. Enjoy!