change color NEED HELP

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

change color NEED HELP

Postby canadian joe » Wed Mar 31, 2010 8:59 pm

i know how to make it so that the color of an object changes all at once by using e.other.color. but how do you make it so that the amount of a color (for example, transparency) doesn't change all at once but only certain amounts are added. i know i am wording this horribly so i will give an example, first the object is transparent, then after a collision it is a little less transparent then after another collision it is even less transparent. this has been done but i can't find it in the forums and studying the scripts confuses me. please help me.
canadian joe wrote:im just writing this so i can sig it


RicH wrote:Phun's Army.
User avatar
canadian joe
 
Posts: 115
Joined: Wed Feb 10, 2010 9:42 pm

Re: change color NEED HELP

Postby Chronos » Wed Mar 31, 2010 10:41 pm

TheWinkits wrote:They both looks of cuking amazing
User avatar
Chronos
[Most Active Member 2010]
 
Posts: 4457
Joined: Mon Aug 31, 2009 6:00 pm
Location: Californania

Re: change color NEED HELP

Postby Mr_Stabby » Thu Apr 01, 2010 12:13 am

(e)=>{color=color+[0,0,0,0.1]}
Mr_Stabby
 
Posts: 155
Joined: Wed Dec 16, 2009 12:16 am

Re: change color NEED HELP

Postby canadian joe » Thu Apr 01, 2010 12:17 am

cool, thanks people. also, how do you set it so that when the variable is depleted any other collidescripts stop? like if the color runs out, it would stop spawning circles.
canadian joe wrote:im just writing this so i can sig it


RicH wrote:Phun's Army.
User avatar
canadian joe
 
Posts: 115
Joined: Wed Feb 10, 2010 9:42 pm

Re: change color NEED HELP

Postby Mr_Stabby » Thu Apr 01, 2010 10:49 am

you could make an if statement to either change the oncollide property of the object or to ignore the contents of oncollide. First one would be more efficient due to no collide script while other still runs through the if statement each time but the second one would also be significantly more stable due to the buggy nature of changing thyme with thyme
Mr_Stabby
 
Posts: 155
Joined: Wed Dec 16, 2009 12:16 am

Re: change color NEED HELP

Postby canadian joe » Sun Apr 11, 2010 7:03 pm

thanks :D
canadian joe wrote:im just writing this so i can sig it


RicH wrote:Phun's Army.
User avatar
canadian joe
 
Posts: 115
Joined: Wed Feb 10, 2010 9:42 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 5 guests