Bounce off the walls?

  • I'm trying to have a ball bounce off of all 4 sides of the screen. I've tried Collide>Propel, but it doesn't quite work. Is there a simple way to have the ball detect that it's hit the side of the screen and bounce off?

  • Make empty objects on all four sides of the screen of which are wall objects. When you collide with an empty object, bounce by messing around with physics.

    Depending on how you're trying to achieve the bounce, you could use gravity, move by, velocity, and behaviors concerning force (among many others).

  • @This do what @GameCRAZY said and set the bounce of the empty objects to 100% and the bounce of the bouncing object to however much of the velocity you want to retain, no behaviours necessary. HyperPad is a bit weird with bounciness and seems to multiply the bounciness together, so having 100% bounciness will not bounce objects with 0% bounciness.

  • @Jack8680 Thanks! Didn't realize I had to set bounciness.

Log in to reply