Sometimes sprite sticks to another sprite instead of bouncing off when they collide

I am having a problem with a game I have been working on. It’s a game of pong with two computer players where the speed can be controlled by clicking on the game scene. The bug i am encountering is that at higher speeds the ball sprite will sometimes stick to the top and bottom boundaries or pass through the players paddles instead of bouncing off. Does anybody know what might be causing this? The collisions in the game are meant to trigger a synthesizer and when the ball sticks to a boundary it continuously triggers and sounds horrible. I have stuck the code on repl.it if anyone would like to have a look.

https://repl.it/join/ctbnvaia-gabrieldavison1

Thanks

Can you make a vid?

simplescreenrecorder-2020-09-03_15.43.03.mkv (243.3 KB)

Here’s a recording of it happening. The behavior I’m talking about is where it sticks to the top boundary and slides along it instead of bouncing off it.

Hi,
I had a similar problem when my character speed is too high and pass trough the floor, resolved with:

create() {
  // set the fps to 120 for good collisions at high speed
  this.physics.world.setFPS(120);
}
2 Likes

Yes, I would try increasing physics FPS.

The bounds problem is odd. Are you using the latest Phaser?

So increasing the FPS seems to have solved the problem. Thanks for the help!