Ball trapped. How do I free it?

daniel.robert.campbelldaniel.robert.campbell Member Posts: 251
edited November -1 in Working with GS (Mac)
I'm having trouble thinking of a solution for a bug I am trying to eliminate. I have a game that randomly spawns targets that the player shoots a ball at. These targets remain on screen until the ball falls to the bottom of the scene hitting a specific actor.

The issue I'm having is that the ball will sometimes get stuck on top of some of the random targets and just sit there. Basically it soft crashes the game! I'm really at a loss with how to fix this one. Any help you could offer would be GREATLY appreciated.

PS: Is it just me or does the "subscribe to topic via Email" option not work right?

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Try changing your targets collision from rectangle to circle then the balls should roll off.

    Collision Shape is found under physics in the actor.

    Darren.
  • PhoticsPhotics Member Posts: 4,172
    daniel.robert.campbell said:
    The issue I'm having is that the ball will sometimes get stuck on top of some of the random targets and just sit there. Basically it soft crashes the game! I'm really at a loss with how to fix this one. Any help you could offer would be GREATLY appreciated.

    The following is a solution that I used in my Valentine's Day App...

    If Orb self.Velocity y is Greater than -50 and Less than 50 for three seconds, then change self.Velocity Y to self.Velocity Y+100.

    That gives the Orb a nudge upward if it gets stuck in a horizontal loop. I also applied a similar rule to X Velocity to prevent cheating.
  • I'd like to try your solution Photics but I'm not sure how to do the, "for three seconds" of the equation. How exactly would I set up this rule?

    Thanks a ton guys I really appreciate.
  • PhoticsPhotics Member Posts: 4,172
    The rule checks the Velocity.

    Inside the rule is a timer.

    Run to completion is not checked.

    The timer is set to "After"

    So, the condition has to be met for the duration of the timer, before the behaviors inside the timer will run.
  • Ah. Brilliant! Thanks bro. I'll try it out. Thanks! this is the last major bug in my game and I really appreciate the help.
Sign In or Register to comment.