How can I have random spawning actors with random colors?

cbowers428cbowers428 Member Posts: 176
edited November -1 in Working with GS (Mac)
I have blocks that fall from the sky and I have a few images of the same blocks in diff colors. I have them spawning randomly, but the blocks only spawn in one color. How can I make them spawn in diff colors?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    hi, I think the following should work, but untested: new integer attribute SpawnColour; in your actor to be spawned, change attribute SpawnColour (or Color if you live in the US!) to random(1,5). Then
    When SpawnColour is 1

    (all or some of these three, depending on the colour)
    Change self.Color.Red to...
    Change self.Color.Green to...
    Change self.Color.Blue to

    When SpawnColour is 2
    Change self.Color.Red to...
    Change self.Color.Green to...
    Change self.Color.Blue to

    etc; up to 5, or as many different colours as you want.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.