## Help needed.

About advanced scenes, and the Thyme scripting language used in Algodoo.

### Help needed.

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    })}`
Kole1911

Posts: 5
Joined: Thu Sep 13, 2018 12:49 pm

### Re: Help needed.

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!
FRA32

Posts: 213
Joined: Wed Dec 03, 2014 9:51 pm 