problem with laser script

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

problem with laser script

Postby silversmart » Fri Oct 14, 2011 9:48 pm

hi all.
i have a problem.
is it possible to adjust the fadedist of a laser with the oncollide of another laser?
ok, i know that its possible. my problem is.
i have one laser(1) that points to the ground. so it collides with the ground.
i have another laser(2) with a fadedist of 0
so i will make the laser(2) with the fadedist of 0 have a fadedist of 1 if the first laser(1) loses the kontakt to the ground.


hope i wrote understandable

best regards bluebravo / silversmart
silversmart
 
Posts: 27
Joined: Tue Jul 05, 2011 7:48 pm

Re: problem with laser script

Postby monstertje3 » Sat Oct 15, 2011 11:16 am

laser(1) oncollide
Code: Select all
scene.my.fadedistance:=scene.my.fadedistance+1

laser(2) fadedistance
Code: Select all
{scene.my.fadedistance}


now when laser(1) collides, laser(2) gets longer
Basically, there are only 10 types of people in the world. Those who know binary, and those who don't.
Light travels faster than sound. That's why some people appear bright until they open their mouths.
User avatar
monstertje3
 
Posts: 343
Joined: Sat Sep 05, 2009 4:29 pm
Location: N-H, NL

Re: problem with laser script

Postby silversmart » Sat Oct 15, 2011 11:02 pm

thank you monstertje3,
thats what i know about.

but my problem is, is there a script, if laser(1) loses the contact to the ground then laser(2) gets a longer fadedist.

i try to explain...
i put laser(1) on a car before the front wheel (wheel ---- wheel ---- laser(1)) with pointing to the ground. if the laser(1) lose the ground contact laser(2) gets a fadedist of 1.0000
the whole time laser(1) hits the ground laser(2) should have a fadedist of 0.100

its so exhausting to explain problems if you are from germany... hope my english is not soooo bad :angel:

best regards bluebravo
silversmart
 
Posts: 27
Joined: Tue Jul 05, 2011 7:48 pm

Re: problem with laser script

Postby KarateBrot » Mon Oct 17, 2011 2:52 pm

Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 5 guests