Scripting Help
5 posts • Page 1 of 1
Scripting Help
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.
-

tallman1996 - Posts: 13
- Joined: Mon Mar 22, 2010 10:16 pm
Re: Scripting Help
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. 
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Scripting Help
You can just don't set color and it will be random.
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Scripting Help
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?
-

TC42 - Posts: 984
- Joined: Sun Jan 09, 2011 1:53 pm
- Location: $ sudo apt get-install sandwich_
Re: Scripting Help
scene.my.randomColor = {(scene.addCircle{density := 0}).color}
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
5 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 8 guests





