Restart Coin Issue HELP&THANKS

kajutokajuto Member Posts: 314
edited June 2012 in Miscellaneous
hi there everyone!! thanks in advance!! the ball collide with the coin it desappear (which is okay), and i press the Pause Button and press Restart actor and its reset all the coin where it was. (which is okay), and when i repeat the same process the coin it's DOESN'T reset the ANYMORE =-(. It's only reset 1 time. HELP

coin actor:

rule#1- overlap or collide with ball
att- self. selfUsed is false (self.att)

change att- self.selfUsed to true

rule#2- att- self.selfUsed is false
change att- self.color.Alpha to 1
Otherwise:
change att- self.color.alpha to 0

rule#3- att-game.restartbutton is true (game att)
change att- self.selfUsed to false

Restart actor:
- when Touch is pressed
-reset scene
-change att- game.restart button to true
-when Touch is pressed
-Unpause Game

Answers

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    You need to move the change attribute restart to true above the reset scene in the restart actor rule. Remember the code is executed in order so the scene resets before the attribute is changed. This is logic so remember when writing your code things happen as you order them both in the rules and in how you stack your code in an actor.
  • kajutokajuto Member Posts: 314
    Thanks for the reply and I hope it's work lol I work almost 2 hrs checking where I was wrong but I didn't imaging it would be this simple as you said...
  • kajutokajuto Member Posts: 314
    edited June 2012
    hi there everyone!! thanks in advance!! the ball collide with the coin it desappear (which is okay), and i press the Pause Button and press Restart actor and its reset all the coin where it was. (which is okay), and when i repeat the same process the coin it's DOESN'T reset the ANYMORE =-(. It's only reset 1 time. HELP

    coin actor:

    rule#1- overlap or collide with ball
    att- self. selfUsed is false (self.att)

    change att- self.selfUsed to true

    rule#2- att- self.selfUsed is false
    change att- self.color.Alpha to 1
    Otherwise:
    change att- self.color.alpha to 0

    rule#3- att-game.restartbutton is true (game att)
    change att- self.selfUsed to false

    Restart actor:
    - when Touch is pressed
    -reset scene
    -change att- game.restart button to true
    -when Touch is pressed
    -Unpause Game
Sign In or Register to comment.