Log In  

Cart #tweetgario-0 | 2021-11-23 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3


My entry for the TweetTweet Jam, a demake of the browser game Agario that fits in two tweets! Use the arrow keys to move the center dot. Touch smaller dots to eat them and become larger, but slower, and don't get eaten yourself. Source code below, just copy/paste into your PICO-8 code editor and the game will run.

p={}l=64x=61y=l::_::b=btn()r=rnd
cls(7)a=all
if(#p<4)add(p,{x=0,y=0,s=9})
z=(b\2%2-b%2)/p[1].s*3w=(b\8%2-b\4%2)/p[1].s*3if(p[1].x==0)x-=z y-=w
for n in a(p)do if(n.s>l)run()
if n!=p[1]then if n.s==9then
n.s=r(10)+2c=1v=1if(r(2)<1)c=-1
if(t)v=-1
n.x=c*l n.y=v*l end
while n.t==nil do
for m in a(p)do
t=r(2)<1if(t and m!=n)n.t=m end end
n.x-=z+sgn(n.x-n.t.x)/n.s*3n.y-=w+sgn(n.y-n.t.y)/n.s*3end
circfill(n.x+l,n.y+l,n.s,8)for m in a(p)do
if(sqrt((m.x-n.x)*(m.x-n.x)+(m.y-n.y)*(m.y-n.y))<n.s+m.s and m.s>n.s)m.s+=n.s n.t=nil del(p,n)end
end?"⌂",x,y,6
flip()goto _
P#100660 2021-11-23 04:59


[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 13:28:16 | 0.009s | Q:12