Problem Changing Scene with score attribute

albertsalibaalbertsaliba Member Posts: 3
edited November -1 in Working with GS (Mac)
I'm building a game that changes from level 1 to level 2 after you get 1500points.

I'm creating a rule: Attribute Game.Score = 1500, Change Scene: Next

Problem is that it works randomly sometimes it works and sometimes I pass the 1500points and doesn't change the scene(the game continues).

I've created the Game Over Rule with the same logic (instead of Score I have an attribute Lives) and it works fine.

Anyone can help please thanks.

Comments

  • okkleokkle Member Posts: 32
    It's because you are using '=', this will make it only activate if the score is spot on 1500, not if it exceeds this.

    Try using greater than or equal to 1500 (the > with a _ underneath, if you're not sure).

    Hope that helps!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    when its greater then or equal to is what you want, not just equal to
  • albertsalibaalbertsaliba Member Posts: 3
    Thanks 4 your quick reply. It makes a lot of sense.

    Thanks again okkle
  • albertsalibaalbertsaliba Member Posts: 3
    Thanks too John.
  • tinmouse77tinmouse77 Member Posts: 10
    Hi! I'm having a similar problem,

    There is a ball that the user drops, if it falls into the goal, the game goes onto the next scene, which works great, but for the first scene only, if the ball goes into the goal on the second scene nothing happens.

    I have an attribute called "goal", when the ball goes into the goal, I set the attribute to 1, if the attribute is = 1 then I goto next scene. but it's not working after the 2nd scene. I also have a problem restting the number of balls per level, It starts with three per level, I can't seem to reset the number to 3 on the next level.

    If anyone has any ideas, pointers I'd be very grateful,

    Thanks in advance! : )

    Timouse
  • butterbeanbutterbean Member Posts: 4,315
    @tinmouse: Make sure you're resetting all your attributes after the player reaches the goal. So if you have a rule that says, if ball overlaps with goal, change goal = 1, go to next scene, make sure you reset those attributes for both the number of balls, and the goal back to 0.

    So it should look like this:

    Rule: If Game.Goal is 1,

    change attribute: Game.Goal to 0

    Change attribute Game.Balls to x (whatever number you want it set for the next scene)

    Timer: after 0.1 seconds: change scene to next scene

    You can also trigger a reset in the next scene in a scene actor, and do it that way if you like. There's more than one way to do it :)

    Hope this helps, or answers your question!
  • tinmouse77tinmouse77 Member Posts: 10
    Ah, That sounds like it, how should I reset those attributes?

    Thanks!
  • tinmouse77tinmouse77 Member Posts: 10
    Ok Let me try it..........
  • tinmouse77tinmouse77 Member Posts: 10
    Ahh Haa!

    It works great! I should have put this on the forum ages ago!

    Thanks Butterbean!!
  • butterbeanbutterbean Member Posts: 4,315
    Glad it worked out for you :) No worries!
Sign In or Register to comment.