Randomly Changing Color of Spawned Actor
I need a little help automatically changing the color of a spawned actor. Say I select 1 of 3 items and every time I touch on the screen (background actor) I want to spawn the actor I selected from the 1 of 3. But in addition to spawning the actor, I also want to randomly change the color of the spawned actor. Is that possible?
I have the first part working, I just need the color of the actor to change randomly when spawned.
For example, when a circle is selected I have a game attribute that says circle = 1. On the background scene I have a rule that says when touch is pressed, and game attribute = 1 spawn circle. Now I want the color of the spawned circle to be a different color other than red when spawned.
Thanks,
Jeff
I have the first part working, I just need the color of the actor to change randomly when spawned.
For example, when a circle is selected I have a game attribute that says circle = 1. On the background scene I have a rule that says when touch is pressed, and game attribute = 1 spawn circle. Now I want the color of the spawned circle to be a different color other than red when spawned.
Thanks,
Jeff
Best Answer
-
kinzua Posts: 554
Use the self.color attribute to control colors.. u'll have to change the RGB.. won't b much of a issue..
Answers