Last active
September 11, 2022 22:46
-
-
Save andymasteroffish/e79a83e64b7df8e9c44241a5e30e4706 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cls() | |
circfill(64,64,11) | |
?"\^w\^tcold sun surf",14,99 | |
?"by @andy_makes" | |
memcpy(0,24576,16384) | |
c=cos | |
s=sin | |
r=rnd | |
pal({9,2,5,130,132,129}) | |
t=0 | |
hs=0 | |
::r:: | |
l={{x=0,y=-50,h=0,v=0,t=1,c=1}} | |
pa=0 | |
f=9 | |
g=1 | |
sc=0 | |
if(t<1)l[1].y=0 | |
::_:: | |
cls() | |
camera(-64,-64) | |
spr(0,-64,-64,16,16-g*5) | |
for i=0,999do | |
x=r(128) | |
y=r(128) | |
v=1+r(2) | |
if(y<90)v=3+r(4) | |
if(sget(x,y)>0)sset(x,y,v) | |
end | |
px=l[1].x | |
py=l[1].y | |
b=btn() | |
if(b==32)goto r | |
if(b>0and b<3)pa-=(b*2-3)/40 | |
h=mid(0,b-3,1)/9 | |
if(f<0)h=0 | |
f-=h | |
if(h*g>0)?"\av1i6x2a" | |
v=pa+r(.1) | |
if(h>0)add(l,{x=px,y=py,h=-c(v),v=-s(v),t=0,c=3.4+r()}) | |
v=r() | |
if(t%32<1)add(l,{x=s(v)*90,y=c(v)*90,h=0,v=0,t=2,c=flr(1+r(2))}) | |
d=31+r(20) | |
add(l,{x=s(v)*d,y=c(v)*d,h=s(v+.25)/2,v=c(v+.25)/2,t=0,c=4+r(3)}) | |
t+=g | |
for o in all(l)do | |
ta=atan2(o.x,o.y)-.48 | |
fr=.98 | |
if(o.t>1)fr=.8 | |
o.h=o.h*fr+c(ta)/9+c(pa)*h | |
o.v=o.v*fr+s(ta)/9+s(pa)*h | |
o.x+=o.h | |
o.y+=o.v | |
h=0 | |
x=o.x | |
y=o.y | |
circfill(x,y,1+o.t,o.c) | |
if o.t==1then | |
for i=-1,1,2do | |
line(x,y,x+c(pa-.45*i)*7,y+s(pa-.45*i)*7) | |
end | |
end | |
la={'f','$',"\ax1ce","\aeb"} | |
if(o.t>1)?la[o.c],x-1,y-2,1+o.c%2 | |
if(abs(x)+abs(y)<17)del(l,o) | |
if o.t>1and abs(px-x)+abs(py-y)<13then | |
if(o.c<2)f=min(f+2,9) | |
sc+=g*(o.c-1) | |
?la[o.c+2] | |
del(l,o) | |
end | |
if l[1].t!=1and g>0then | |
g=0 | |
hs=max(hs,sc) | |
for a=0,1,.02do | |
v=2+rnd(1) | |
add(l,{x=x,y=y,h=c(a)*v,v=s(a)*v,t=0,c=1}) | |
end | |
if(t>2)?"\ai6s1ceabc" | |
end | |
end | |
for i=1,80*g,2do | |
line(55,40-i,60,40-i,2-sgn(f*9-i)) | |
end | |
if(t>1)?"$"..sc,-8,-56,1 | |
if(hs*(1-g)>0)?"best:\n$"..hs,-63,-63 | |
if(t<2)?"collect fuel ◆ collect money\n ⬅️+➡️ turn ◆ 🅾️ to thrust\n\*8 ❎ to reset",-56,-60,2 | |
flip()goto _ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment