Is test of worm
Code
a={} for i=1,20 do b={} b.x=64 b.y=64 add(a,b) end function _update() if (btn(0)) a[1].x-=1 sfx(0) if (btn(1)) a[1].x+=1 sfx(0) if (btn(2)) a[1].y-=1 sfx(0) if (btn(3)) a[1].y+=1 sfx(0) for i=2,20 do a[i].x=a[i].x*0.8+a[i-1].x*0.2 a[i].y=a[i].y*0.8+a[i-1].y*0.2 end end function _draw() cls() for z in all(a) do spr(1,z.x,z.y) end end |
[Please log in to post a comment]