Page 1 of 1

### Help needed.

Posted: Fri Sep 14, 2018 7:50 pm
So uhm, i'm trying to make a bullet circle script but it mostly failed.
basically it would shoot by the count of 360/n amount, the amount consists of how many projectiles will be spawned, help will be appreciated!

Also here's what i have for now.

Code: Select all
`(e)=>{    spd = math.pi / 2 * 181;    eq = [math.sin(spd * sim.time), math.cos(spd * sim.time)];    Scene.addcircle({        pos := e.pos;        attraction := 0;        radius := 0.06;        heterocollide := true;        collideset := 2;        drawcake := false;        drawborder := false;        color := [1, 0, 1, 1];        density := 1;        vel := eq;        pos := e.this.pos + 0.5 * eq;        timeToLive := 5;        friction := 0.01;        restitution := 0    })}`

### Re: Help needed.

Posted: Mon Sep 24, 2018 12:48 pm
Can you elaborate what exactly you want to acomplish, and what failed? I am unfortunally not yet able to deduce from the given information what the desired result should look like.
If you want something to spawn bullets in a circle around some point, the script would look like this:
Code: Select all
`(e)=>{   n = 10;   bulletspeed = 10;   bulletDist = 2;   for(n,(i)=>{      ang = 2*math.pi/n*i;      scene.addCircle({         pos := pos+bulletDist*[math.cos(ang),math.sin(ang)];         vel := bulletSpeed*[math.cos(ang),math.sin(ang)];         radius := 0.06;         heterocollide := true;         collideset := 2;         density := 1;         drawcake := drawborder := false;         color := [1,0,1,1];         timetolive := 5;         friction := 0.01;         restitution := 0;      })   })   }`

I hope this helps for now!