Randomly change image/color

JamwithnoJamwithno Member Posts: 312
edited November -1 in Working with GS (Mac)
I was wondering how do you make an image change its color and when it is a certain color you can destroy the actor? Please help your my only hope lol
Just kidding but please help.

Comments

  • MrshoestoreMrshoestore Member Posts: 181
    I would create two attributes, one (lets just call it color.changer) would be an index attribute. The other would be a boolean attribute (we'll call color.destroy)

    So, create a rule that when attribute color.changer = 1
    change image to (what ever you first color is)

    do this for all colors, changing the color.changer number for each different one.

    Then to do the random thing, assuming you want to change it with a timer and not a collision or something:

    do behavior Timer, every (whatever time) change attribute color.changer to random(1,(highest number))

    for the destroy part:

    create rule, when color.changer equals (# of the color that can be destroyed) change attribute color.destroy to true, otherwise attribute color.destroy is false

    than whatever it is that you do to destroy it, make sure in the rule that color.destroy must be true in order to do whatever it is the do's in order to destroy.

    that..is what I'm thinking... hope that helps, if not... sorry, I tried :)

    I did something sortakinda similar with a color change in my game, so that's how I would do it, it just might need some tweaks to work exactly how you want it to... or more, I don't know, I'm not exactly looking at gamesalad right now. :)
Sign In or Register to comment.