Help with a collide script

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

Help with a collide script

Postby Fossa2 » Sun Feb 16, 2025 1:41 pm

I see this forum is very quiet. I hope that someone is still lurking around that can help.

I need help with a collide script. I do not speak Thyme and I think I am getting lost in the syntax.

Here is my goal. When a marble collides with an object, 8 new identical marbles are created each having a tracer. Then the object disappears.

With the script I have, I get 8 new identical marbles, but the first marble gets all the tracers. So I have 7 new marbles along with another new marble that has 8 tracers attached to it.

My code is below. Any help?


(e)=>{
for(8, (i) =>
{
newMarble := scene.cloneEntityTo(e.other, e.pos);
scene.addPen({
geom := newMarble.geomID;
pos := newMarble.pos;
size := 0.70;
color := e.other.color;
zDepth := -1;
fadeTime := 0.3
})
});
timeToLive = 0
}
Fossa2
 
Posts: 1
Joined: Mon Jan 27, 2025 6:24 pm

Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 6 guests