White Arrow
White Arrow
An endless asteroids clone where the screen progressively fills with more and more rocks!
Your weapon upgrades every 4th level, and more asteroids spawn in when your level increases (1 extra rock with each new level).
The ship's hitbox is 1x1 (shown by the pixel in the middle of the ship) and there's no momentum so you can do some dodging.
Left and Right | Rotate ship |
Up | Move ship forward |
X | Fire |
In 1024 compressed bytes for the PICO-1K Jam 2022 https://itch.io/jam/pico-1k-2022
pl={0,4,8,8,6,4,8,0,0,4} rk={1,1,4,0,7,2,8,4,7,6,4,8,1,7,0,4,1,1} function rks(s,n,x,y) if #r<200 then for i=1,n do if x==nil then a=rnd(160) b=(rnd(2)\2)*160 o=rnd{{a,b},{b,a}} x=o[1] y=o[2] end add(r,{x=x,y=y,t=r, s=s,a=rnd(),d=rk, h=1,v=.3+rnd()}) end end end function draw(m,c) for a in all(m) do o=a.d t=a.a if (a.t==r) t+=ra sa,ca=sin(t),cos(t) for i=1,#o,2 do x=(o[i]-4)*a.s y=(o[i+1]-4)*a.s m=x*sa-y*ca+a.x n=x*ca+y*sa+a.y if (i>1) line(k,l,m,n,c) k,l=m,n end end end function move(m) for a in all(m) do a.x=(a.x-sin(a.a)*a.v+8)%160-8 a.y=(a.y-cos(a.a)*a.v+8)%160-8 if (a.t==f or a.t==g) a.h-=1 end end function kill(m) for a in all(m) do if (a.h==0) del(m,a) end end function coll(m,n) for a in all(m) do for b in all(n) do if a.h and b.h>0 then x=a.x-b.x y=a.y-b.y if x*x+y*y<a.s*a.s*8 then a.h=0 b.h=0 if a.t==r then ?"\a1dad" sco+=1 add(g,{x=a.x,y=a.y,t=g,s=a.s*.5,v=1.5,h=5,d=rk,a=-a.a}) add(g,{x=a.x,y=a.y,t=g,s=a.s*.5,v=1.5,h=5,d=rk,a=a.a}) if (a.s>1) rks(a.s-1,5-a.s,a.x,a.y) end end end end end end function _init() r={} f={} g={} p={x=64,y=64,a=0,s=1.5,v=1.5,h=1,d=pl} sco=0 lsco=10 sta=1 lev=1 tic=0 cd=0 ra=0 rks(3,4) sfx(-1,-2) ?"\a2shl08d0..d..c#." ?"\a3syl0wf1efad.fefad.c#.e.fefad.fefaa#agfec#" end function _update() if sta==1 then if (btn(0)) p.a-=.025 if (btn(1)) p.a+=.025 if (btn(2)) move({p}) if btn(5) and tic>=cd then cd=tic+8 ?"\a0d2ad" l=lev\4/2 for i=-l,l do add(f,{x=p.x,y=p.y,t=f,s=.3,v=4,h=20,d=pl,a=p.a+i*.1}) end end move(r) move(f) move(g) coll(r,f) coll(r,{p}) kill(r) kill(f) kill(g) if (p.h==0) then sta=2 ?"\a3sfl08bfd" end if sco>lsco then lev+=1 lsco+=lev*6 rks(3,lev) end ra+=.025 end if sta==2 then p.s-=.025 p.a+=.025 if (p.s<.025) sta=3 end if (sta==3 and btn(5)) _init() tic+=1 end function _draw() cls(1) draw(g,2) draw(r,12) draw(f,9) pset(p.x,p.y) draw({p},8-sta%2) if (sta==3) ?"game over!\npush x\n",48,48 ?"score:"..sco ?"lev:"..lev end
Leave a comment
Log in with itch.io to leave a comment.