Two things will be delete after crash

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

Two things will be delete after crash

Postby dogwong » Sat Nov 14, 2009 3:34 pm

(My English not very good, sorry)

I asked last time, "density = 0" is a way to delete the thing

but this time i want two things will be delete after crash

just like this:

O------------> <--------------O
OO (crash)
(both no more)

for the first one, i can make it onCollide : (e)=>{density = 0}
but I can't use this for the second one, because before the second object crash on to first object, second object have already collide.

If I do not explain clearly, please tell me, thanks!
dogwong
 
Posts: 8
Joined: Wed Oct 21, 2009 12:28 pm

Re: Two things will be delete after crash

Postby electronicboy » Sat Nov 14, 2009 3:56 pm

try this on the first object
Code: Select all
(e)=>{e.other.density = 0; e.this.density = 0}
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: Two things will be delete after crash

Postby dogwong » Sun Nov 15, 2009 3:52 am

oh yes, thanks!
how about
if two things crash, one of it will delete, and the gun will be delete also (LOL)

thx
dogwong
 
Posts: 8
Joined: Wed Oct 21, 2009 12:28 pm

Re: Two things will be delete after crash

Postby standardtoaster » Sun Nov 15, 2009 4:05 am

So you have an entire gun and you want to delete it as well as the two objects?

Make a variable:
Code: Select all
scene.my.density  = 2

In the onCollide script of an object put:
Code: Select all
scene.my.density = 0

In the density part of the script menu on the gun put:
Code: Select all
{scene.my.density}


How's that?
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 14 guests