Play game
Pico Survivors's itch.io pageCompressed Bytes used
1024
Source Code (OPTIONAL)
a={}b={}c=0d=10e=0f=2g=30h=0j=0.3k=0.5l=64m=64n=0.5o=100p=0q=false r=0s={ceil(rnd(4)),ceil(rnd(4))}t=0
function _update60()
r-=1
if(q==false and o>0)then
u=1h-=1e+=1
if(e%max(60-flr(e/1800),10)==0)b[#b+1] = {(flr(rnd(2.7)/2)*126)+1,rnd(96)+16,1+(flr(e/600)*0.1),(flr(rnd(1.3))*0.05)+0.15}
if(btn(0)==true or btn(1)==true)and(btn(2)==true or btn(3)==true)then u=1.45 end
if(btn(0)==true)l=max(l-(j/u),1)n=0.25
if(btn(1)==true)l=min(l+(j/u),126)n=0.75
if(btn(3)==true)m=min(m+(j/u),126)n=0
if(btn(2)==true)m=max(m-(j/u),4)n=0.5
if(btn(0)==true and btn(2)==true)n=0.37
if(btn(1)==true and btn(2)==true)n=0.62
if(btn(1)==true and btn(3)==true)n=0.87
if(btn(0)==true and btn(3)==true)n=0.12
if(btn(5)==true and h<=0)a[#a+1]={l+1,m+1,sin(n+(rnd(p*2)-p))*k,cos(n+(rnd(p*2)-p))*k,f}h=g
for i,v in pairs(b) do
if(v[3]<=0)deli(b,i)c+=1goto c1
if(v[1]>=l-2 and v[1]<l+3and v[2]>=m-2 and v[2]<m+3)o-=1
v[1]-=(cos(atan2(v[1]-l,v[2]-m))*v[4])v[2]-=(sin(atan2(v[1]-l,v[2]-m))*v[4])
::c1::
end
for i,v in pairs(a) do
v[1]+=v[3]v[2]+=v[4]if(v[1]<1or v[1]>127or v[2]<5or v[2]>127)deli(a,i)goto c2
for i1,v1 in pairs(b) do if(v[1]>=v1[1]and v[1]<v1[1]+3 and v[2]>=v1[2]and v[2]<v1[2]+3)v1[3]-=v[5]deli(a,i)goto c2 end
::c2::
end
end
if(c>=d)r=60c=0d+=2t=0q=true
if(btn(5)==true and r<=0)t=2
if(btn(4)==true and r<=0)t=1
if(t>0and q==true)then
if(s[t]==1)f*=1.25d*=1.2
if(s[t]==2)g*=0.8p+=0.01
if(s[t]==3)k=min(k*1.1,1)p*=0.9
if(s[t]==4)j*=1.1p+=0.02
s={ceil(rnd(4)),ceil(rnd(4))}q=false
end
end
function _draw()
rectfill(0,0,127,127,1)
for i=1,#b do if(b[i]~=nil)rectfill(b[i][1],b[i][2],b[i][1]+2,b[i][2]+2,8+flr(b[i][4]*6))end
for i=1,#a do if(a[i]~=nil)pset(a[i][1],a[i][2],10)end
rectfill(l,m,l+2,m+2,11)
rectfill(0,0,127,3,0)
rectfill(0,2,127*(h/g),3,9)
rectfill(0,0,127*(c/d),1,12)
if(q==true)then
?"π
ΎοΈ:",1,40,7
if(s[1]==1)?"+dmg,-f.spd",12,40
if(s[1]==2)?"+f.spd,+spr.",12,40
if(s[1]==3)?"+pj.spd,-spr.",12,40
if(s[1]==4)?"+spd,++spr.",12,40
?"β:",1,48
if(s[2]==1)?"+dmg,-f.spd",12,48
if(s[2]==2)?"+f.spd,+spr.",12,48
if(s[2]==3)?"+pj.spd,-spr.",12,48
if(s[2]==4)?"+spd,++spr.",12,48
end
?flr(e/6)/10 .."s",1,11,7
?"β₯"..o,0,5
if(o<=0)?"you died!",46,64
end
Leave a comment
Log in with itch.io to leave a comment.
Comments
Impressive entry with neat enemy AI π
(alas, I'm not very good at these games - so I won't post my awful score! π )
Nice one! π€