Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
A jam submission

Bonus Stage 1KView game page

A #pico-8 demake of the iconic spherical bonus stages in Sonic games. Produced for the 2022 #pico1k jam.
Submitted by Macario (@MacarioMorenoUK) — 8 days, 22 hours before the deadline
Add to collection

Play game

Bonus Stage 1K's itch.io page

Compressed Bytes used
1016

Source Code (OPTIONAL)
g={}
mc={{0,3,0,3,1,1,1,3},{3,2,1,0,0,0,1,2},{1,1,1,0,3,0,1,1},{1,0,0,1,3,1,0,0},{1,0,3,3,2,3,3,0},{3,0,0,1,3,1,0,0},{1,1,1,0,3,0,1,1},{3,2,1,0,0,0,1,2}}f=0
go=true
function li()u0=1
u1=0
u2=0
v0=0
v1=1
v2=0
f=0
e=0
de=0
du=0
dv=0
t2=0
n2=0
n3=0
go=false
for i=0,31 do
m=mc[(i&7)+1]for j=0,31 do
n=m[(j&7)+1]if n==2 then
t2=t2+1
end
mset(i,j,n)end
end
end
function _init()for t=-64,63 do
gt={}for s=-64,63 do
a=s>>6
b=t>>6
l=b+1<<5
m=a*a+b*b+1
i=l/m
j=1024/m
k=i*i-j
if k>=0 then
d=i-sqrt(k)gt[s]={a*d,d-12}end
if #gt>0 then
g[t]=gt
end
end
end
li()end
function _update()if f==0 then
if go then
li()end
de=0
du=0
dv=0
if btn(0) then
de=-1>>7
else
if btn(1) then
de=1>>7
else
du=u1>>3
dv=v1>>3
end
end
i=u2>>2&31
j=v2>>2&31
n=mget(i,j)if n==1 then
de=1>>5
du=0
dv=0
go=true
end
if n==2 then
n2=n2+1
mset(i,j,0)if n2==t2 then
de=-1>>5
du=0
dv=0
go=true
end
end
if n==3 then
n3=n3+1
mset(i,j,0)end
end
f=f+1&31
e=e+de
ce=cos(e)se=sin(e)u0=ce
u1=-se
v0=se
v1=ce
u2=u2+du
v2=v2+dv
end
function os(u,v)x=(u-u2)*u0+(v-v2)*v0
y=(u-u2)*u1+(v-v2)*v1-20
i=x
j=32-sqrt(max(0,1024-x*x-y*y))h=32+y
if h>1 then
return {1+i/h<<6,1+j/h<<6,64/h}end
end
function cd(i,j)c=mget(i&31,j&31)if c>0 then
std=os(i<<2,j<<2)if std then
s=std[1]t=std[2]d=std[3]if c<3 then
m={8,12}circfill(s,t-d,d,m[c])else
m=f>>5
n=d*(m-.5)oval(s-n,t-d-m,s+n,t-m,10)end
end
end
end
function _draw()cls(1)for t=-64,63 do
gt=g[t]if gt then
for s=-64,63 do
local uv=gt[s]if uv then
c=uv[1]*u0+uv[2]*u1+u2&4^^uv[1]*v0+uv[2]*v1+v2&4
c=4+5*c/4
pset(64+s,64+t,c)end
end
end
end
j2=v2>>2&-1
jd=-sgn(u0)j0=j2-5*jd
j1=j2+5*jd
i2=u2>>2&-1
id=-sgn(u1)i0=i2-5*id
i1=i2+5*id
if u0*u0>u1*v1 then
for j=j0,j1,jd do
for i=i0,i1,id do
cd(i,j)end
end
else
for i=i0,i1,id do
for j=j0,j1,jd do
cd(i,j)end
end
end
std=os(u2,v2)s=std[1]t=std[2]d=std[3]h=f>>4
circfill(s,t,.75*d,0)?'웃',s-3,t-3-h,15
?'🐱',s-3,t-7-h,15
s2='00'..n2
?sub(s2,#s2-2,#s2),10,10,7
circfill(26,12,3,12)s3='00'..n3
?sub(s3,#s3-2,#s3),108,10,7
circ(102,12,3,10)end

Link to Commented Source Code (OPTIONAL)
https://www.lexaloffle.com/bbs/?uid=24365

Leave a comment

Log in with itch.io to leave a comment.

Comments

No one has posted a comment yet