Score/reset scene problem

BrynjeBamsenBrynjeBamsen Member Posts: 188
edited November -1 in Working with GS (Mac)
hi GS'ers

Let me see if i can explain what i am working on.

Lets say you have a ball that you need to get into a goal with 3 tries.
When you have used the 3 and final shot, the scene will reset unless you've reached the goal.

My problem is! if you make it with the last shot the scene should NOT restart but go to next scene.
My temporary solution is: the scene restarts when shots count = -1

But i dont think its a very good solution

Any good ideas how make a better solution?

Comments

  • JeffreyShimaneJeffreyShimane Member Posts: 372
    It sounds like you're subtracting 1 from the ball used attribute before it's out of play (i.e. it did not get into the goal). If you subtracted 1 after it goes out of play (or stops moving), you could have a rule in the ball actor that goes to the next scene when it collides with the goal actor. That way, if the ball goes in the goal, it will go to the next scene, but if it does not and it's the final ball, the scene will reset.
  • BrynjeBamsenBrynjeBamsen Member Posts: 188
    There a few issues with that solution.

    #1: If i subtrackt when ball stop moving, i will substract all shots at once because of the initial lie of the ball is still.
    Furthermore it will enable the player to keep moving the ball (not letting it rest) and not lose any shots.

    I have a Goal actor with a collide rule that will take me to next scene. but when using the "last shot" it does not reach it due to scene reset.

    any other ideas???
  • BrynjeBamsenBrynjeBamsen Member Posts: 188
    Solved

    I made an integer called Scene Reset that changes when goal sensor collides with my ball

    BALL ACTOR
    Rule
    Attribute.Game.Shot = 0
    Attribute.Game.Scene Reset = 0
    Self.motion.linear Velocity.X = 0
    Self.motion.linear Velocity.y = 0
    Reset Scene

    IF
    Ball overlaps with Goal senser
    Change attribute Game.Scene reset to Game.Scene Reset +1
Sign In or Register to comment.