Bounce on walls, sometimes stuck...

MegaEduXMegaEduX Member Posts: 2
edited April 2012 in Working with GS (Mac)
I am having a problem with physics in my game.

Basically, I have a ball that bounces on walls. But, sometimes, the ball gets "stuck", like shown in this video.



I spawn it with a direction of 300 and an acceleration of 100, if that helps.

Best Answer

  • tenrdrmertenrdrmer Posts: 9,934
    Accepted Answer
    Add in a rule that when the x velocity hits zero it changes runs an acceleration rule to move toward the other half of the screen

    Something like

    When Self position x > 240 and
    self.leniearvelocity.x =0
    -Accelerate in a direction of 180 at 100

    Something along those lines. Also I believe the block breaker demo has some rules for fixing this problem as well. you could also place an actor at both ends and revers the x velocity when the ball hits it.

Answers

Sign In or Register to comment.