This is fun, nice job. I agree the bounce animation is great.
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.