Touch to change (simple stuff that I cant figure out)

cnmeyer1980cnmeyer1980 Member, PRO Posts: 211
edited November -1 in Working with GS (Mac)
Hi guys,

Sorry, time for another question.

Just wondering how to do the following, i've tried a couple of ways and unfortunately non of them work, I do try to sort things out before I ask for help on here - honest :-)

Basically, I've 4 colour squares at the bottom of the screen, above it is another square that changes colour depending on what box you've pressed - sounds like simple stuff. I've currently made it so if for example, colour = 1 spawn actor 1, colour = 2 spawn actor 2 and so on - this in a way works, but keeps spawning over the top of eachother and kind of looses it after a couple of clicks.

I would love to know if any of you know how to fix this, I've done some much harder stuff in GameSalad and its really annoying that I appear to have come stuck at something that seems so simple.

I can send the project to anyone who may be able to help (I only started it last night so there isn't really that much to see).

Cheers all,

Chris

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    have a attribute called selectedColor

    In the first colored square have a rule when touch is pressed change selectedColor to 1

    In the second colored square have a rule when touch is pressed change selectedColor to 2

    In the third colored square have a rule when touch is pressed change selectedColor to 3

    In the forth colored square have a rule when touch is pressed change selectedColor to 4

    Then in the actor on top u want to change colors have rules when selectedColor=1
    then have change attribute behaviors changing the self color attributes to the color you want. So if the first square is blue the rule would be when selectedColor=1
    change attribute self color blue to 1
    change attribute self color green to 0
    change attribute self color red to 0

    Then repeat with rules when selectedColor=2 and change the color attributes to match the next color and keep repeating

    hope that helps
  • cnmeyer1980cnmeyer1980 Member, PRO Posts: 211
    Hi guys,

    Thank you both so much for your advise above - I will give them both a go shortly. I'm sure you've saved me bags of time trying to figure this out - I really do appreciate it.

    Cheers and thanks again,

    Chris
Sign In or Register to comment.