Scripting Help

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

Scripting Help

Postby tallman1996 » Sat Jan 15, 2011 10:37 pm

I know basic scripting with "on collide" and that the code for changing a color is e.other.color = [0,0,0,1] (I did this for black.) What code do I do if I want a random color? I have tried many different ways, but none of them work.
User avatar
tallman1996
 
Posts: 13
Joined: Mon Mar 22, 2010 10:16 pm

Re: Scripting Help

Postby Rideg » Sun Jan 16, 2011 10:33 pm

Search this forum section. I belive I've seen Kilinich come up with a few random functions. Look them up and see if they can help you. :)
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Scripting Help

Postby Kilinich » Mon Jan 17, 2011 8:45 am

You can just don't set color and it will be random.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Scripting Help

Postby TC42 » Tue Jan 18, 2011 10:16 pm

Kilinich wrote:You can just don't set color and it will be random.


That only works for spawning, not oncollide e.this.color changing. I think. Correct me if I'm wrong?
Image
Spambot wrote:Nowadays, memes usually are studied less in the field of biology, but more with the arena of psychology along with sociology. But, the major area of a meme, getting embraced and imitated all the time is what’s at any core connected with any meme.
User avatar
TC42
 
Posts: 984
Joined: Sun Jan 09, 2011 1:53 pm
Location: $ sudo apt get-install sandwich_

Re: Scripting Help

Postby Kilinich » Wed Jan 19, 2011 12:14 am

scene.my.randomColor = {(scene.addCircle{density := 0}).color}
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 8 guests

cron