change code of another object
4 posts • Page 1 of 1
change code of another object
hey is there a way to change the code of another object
how could i acomplish this or is it even possible?
- Code: Select all
(e)=>{e.other.color = [0, 1, 0]; e.other.colide = [e.other.color = {0, 1 ,0}}
how could i acomplish this or is it even possible?
- jordan30001
- Posts: 11
- Joined: Mon Aug 16, 2010 4:03 pm
Re: change code of another object
well seeing all the mistakes besides your question, I would first check out the tutorials on scripting here. Then you should be better able to acomplish what you want to do, which is, by the way, this.
- Code: Select all
(e)=>{e.other.color = [0, 1, 0, 1]; e.other.onCollide = (e)=>{e.other.color = [0, 1 ,0, 1]}}
-

Versieon - Posts: 375
- Joined: Tue Sep 01, 2009 4:45 pm
Re: change code of another object
(e)=>{e.other.color = [0, 1, 0, 1]; e.other.onCollide = (e)=>{e.other.color = [0, 1 ,0, 1]}}
whats the fourth 1 in [0, 1, 0, 1] ?
also could i do this and make it loop infinite times
(e)=>{e.other.color = [0, 1, 0, 1]; e.other.onCollide = (e)=>{e.other.color = [0, 1 ,0, 1]; e.other.onColide = (e)=>{e.other.color = [0, 1, 0, 1}}}
also while im hear is there a way to randomly pick a colour out of a list say like
[1, 0, 0]
[0, 1, 0]
[0, 0, 1]
whats the fourth 1 in [0, 1, 0, 1] ?
also could i do this and make it loop infinite times
(e)=>{e.other.color = [0, 1, 0, 1]; e.other.onCollide = (e)=>{e.other.color = [0, 1 ,0, 1]; e.other.onColide = (e)=>{e.other.color = [0, 1, 0, 1}}}
also while im hear is there a way to randomly pick a colour out of a list say like
[1, 0, 0]
[0, 1, 0]
[0, 0, 1]
- jordan30001
- Posts: 11
- Joined: Mon Aug 16, 2010 4:03 pm
Re: change code of another object
colors are in RGBA or HSVA format, both of which uses four numbers to correlate to a color.
so the fourth 1 means that the color will be fully opaque.
to loop the effect forever, you will only need to put this.
picking a list randomly from a list is a bit more complicated, although colors are random if not specified.
so the fourth 1 means that the color will be fully opaque.
to loop the effect forever, you will only need to put this.
- Code: Select all
(e)=>{e.other.color = [0, 1, 0, 1]; e.other.onCollide = e.this.onCollide}
picking a list randomly from a list is a bit more complicated, although colors are random if not specified.
-

Versieon - Posts: 375
- Joined: Tue Sep 01, 2009 4:45 pm
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests



