Add to attribute value

snortchsnortch Member Posts: 19
edited November -1 in Working with GS (Mac)
I think I must not be thinking about this right. Here's what I'm trying to do:

1. I have a game attribute called TimesClicked
2. I have a red, green and blue square. On click of the red, greed and blue square - I would like to add 1 to the value of the TimesClicked game attribute.
3. When the value of the TimesClicked attribute = 3 - I want all three squares to grow.

I know how to get the squares to grow, but I can't figure out how to add +1 to the attribute each time one of the squares is clicked.

Here is what I have tried:

1. On click of Red (or green or blue) -change attribute of game.TimesClicked to +1
2. I created another rule that says when attribute TimesClicked = 3, grow the squares.

again the problem is that I can't get the value of the attribute to add 1 each time my red, greed or blue squares are clicked.

It’s a very simple experiment really. I'm trying to figure out how to use GS and so far, I'm confused.

Anyone have any ideas?

Comments

  • devjohnsondevjohnson Member Posts: 94
    snortch said:

    1. On click of Red (or green or blue) -change attribute of game.TimesClicked to +1

    Are you setting the attribute game.TimesClicked = "+1" or "game.TimesClicked+1"?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    in the red green and blue actors you should ahve your rule when touch is pressed change atttribute timesclicked to timesclick+1

    make sure your selecting the attriubte both timess from the drop down menu and not typing it in.

    then in the red green and blue actors have anoteher rule in each one when attribute timesclicked=3 then your chnage size rules.

    again selecting the attriubte from the drop down and not typing it in
  • snortchsnortch Member Posts: 19
    Nice -Thank you for the suggestions. John, I think that your suggestion to use the dropdown helped. I was just typing +1 in the 'to' field.

    So, everyone's suggestions helped, but I still have one problem that I haven't been able to figure out. I can't get my green square to cause the attribute to increment when I click on it. Take a look:

    http://screencast.com/t/qvvBjchgxcqq

    Any ideas why?
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    The green actor prototype looks correct. However, you may have previously edited the green actor in the scene and that would prevent it from being automatically updated with the green actor prototype. Some things to try:

    1) Delete the green actor in the scene (not the prototype) and drag a fresh one into the scene.

    2) Delete the green actor prototype and create a new one by option-dragging the red or blue one then modifying the color to green.

    On occasion, I've run into actors that do not show up or do not function correctly and doing one of the above usually solves it.
  • snortchsnortch Member Posts: 19
    nice Masta - you're suggestion was right on. I had unlocked the green square actor at one point and forgot about it.

    Now it it incrementing as expected. This now makes me wonder what the point of locking actors that have been placed within a scene is. I understand that placing it in the scene is an instance of the actor, but I would think that I should be able to create one off rules for instances of actors that have been placed within the scene.

    I bet that's what its supposed to do, but I was running into some other issue.

    Thanks all for your help. Really nice of you to weigh in and give suggestions.
Sign In or Register to comment.