Number Order by Click Order Problem

mmzbrmmzbr Member Posts: 311
edited March 2012 in Working with GS (Mac)
Hey guys,

I'm trying to make a logic that when I press a button a number appear but following a order (1-2-3-4...) based on click.

Here a example:
image
User press the first button (first position ), then the second button (fifth position)
image
-------------------------------------------------
image

Now scene was reseted, user press the first button (third position), then the second button (second position)
image
-------------------------------------------------
image

Could someone help with the logic behind it?

Best Answer

  • simo103simo103 Posts: 1,331
    edited March 2012 Accepted Answer
    @mmzbr ..

    need to create a Game attribute Game.ClickCount

    In all actors:

    then when actor is touched change:

    Game.ClickCount=Game.ClickCount+1

    need to create a self attribute integer "What number am I".

    Rule 'self.What number am I" equals Game.ClickCount.

    then

    Also need a rule to set them back to zero

Answers

  • calvin9403calvin9403 Member Posts: 3,186
    make an attribute button pressed? int 0

    when touch is pressed display text attribute+1, THAN change attribute to attribute+1
  • mmzbrmmzbr Member Posts: 311
    edited March 2012
    @calvin9403 I've tried that but didn't worked, when you press a button its change the value in all buttons every time you click on. I have to keep first 1, then when I press the second , the first button value have to be 1 and second 2.

    But thanks for your reply.
  • mmzbrmmzbr Member Posts: 311
    edited March 2012
    @simo103
    Using your logic and made some adjusts now its working as intent. Thank you very much!
  • simo103simo103 Member, PRO Posts: 1,331
    @mmzbr .. excellent. I played a round with a quick demo .. so if you want to compare .. it is on this page on the right titled 'Touch Count Demo' ... I added a Reset and a USED attribute so you can't click the same spot twice:

    http://www.funkymunkygames.com/Gamesalad/search/
Sign In or Register to comment.