.

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

.

Postby RaRaMalum » Tue Sep 01, 2009 2:48 am

.
Last edited by RaRaMalum on Wed Jun 03, 2020 8:59 pm, edited 1 time in total.
Phundamentalists, come to the dark side.
We have much cooler toys.
User avatar
RaRaMalum
[Best newcomer 2010]
 
Posts: 280
Joined: Mon Aug 31, 2009 10:47 pm

Re: if statment in the color field for spawned objects

Postby KarateBrot » Tue Sep 01, 2009 3:01 am

add this to your scene.addCircle()
Code: Select all
color := {{sim.time == 10} ? {[0, 0, 1, 1]} : {[0, 0, 0, 1]}}

Or is the problem a different one?

[edit]
oh ok... just tested it out. now i know what your problem is. so forget about this post. :D
but that's weird... i try to do something else if i have an idea.
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: if statment in the color field for spawned objects

Postby Chronos » Tue Sep 01, 2009 3:09 am

it doesnt automatically correct it. if sim.time is over 10 when it spawns, its gonna be black, no exceptions (unless the code is wrong)

if its still doing this when sim.tim ISNT over 10, something wrong then
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: if statment in the color field for spawned objects

Postby KarateBrot » Tue Sep 01, 2009 3:17 am

i know what's wrong...

the code is working and it changes the color after 10 seconds, that's no problem BUT that only happens to the latest spawned circle!
so if you spawn 5 circles and now wait the 5. circle will change its color. the other ones stay at black so this seems to be a bug. it's really worth reporting it.
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 0 guests