Problem with change scene

GuaveMediaGuaveMedia Member, PRO Posts: 1,262
edited December 2011 in Working with GS (Mac)
Hey,
I have the following problem, when my level is completed and a button is pressed, the scene get's changed.But sometimes scene gets changed without pressing the button immediately after the level is finished.
I have these attributes:

Collect: When something is collect change to +1...
Finish: when collect = 3 set finish to true
Fail: when level fails, set fail to true

In my button I have this:

when touch is pressed
finish is true
change scene
set collect 0
set fail to 0

Can someone tell me my mistake?

thx

Comments

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Reset collect and fail to 0 before changing scene

    Also, where is your button, is it off screen or just alpha at 0? Because if its alpha you may want to add into the rules that alpha needs to be 1 as well as just because you can't see it, its still active
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Yes alpha is set to zero and when finish is true, alpha is set to 1.

    So you mean:

    In the touch rule also add if self colour =1
    and set collect and fail to zero before changing scene..

    thx
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Yup, give it a go and see if it helps.

    Does the level randomly range scene after the 1st level or does it happen at 1st run as well.

    Im assuming its all down to you changing scene before resetting values. That way the second you start the next level it thinks collect is still true. You should always reset your values and then change scene as the last thing you do.
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    edited December 2011
    Yeah but I cant set collect to zero before changing scene because then the level would not be finished!
    And each level is based on the same principe. So somehow I have to set collect back to zero when switching to the
    next scene...
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Okey tried it, same happens again :/

    Just for information, in the game fruits have to be tapped and these fruits set the attribute collect each time to a certain value.
    But they only do that when finish is false AND fail is false...

    It is killing me :/
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    May someone please help me :)
    I really try to solve it but it does not work :(
Sign In or Register to comment.