Ball stops bouncing

Got a simple game using phaser 3 with arcade physics.
A ball bounces around a set of boarder walls.
The play must avoid the ball going through a maze.

Problem: At times the ball stops bouncing and just goes left and right on the bottom boarder wall.
Not sure how to repeat this.
This has happened on a laptop using Chrome and using Edge
And also on an older iPhone and older iPad and a newer Android device.

Any and all ideas would be great!

mazedodger1.freevar.com
Thank you,
Richard

I got to level two, and then got hit by the ball on purpose. It seems to only happen when the ball hits the player. I’m using an iPhone. Are you having the scene restart, or just repositioning the sprites? If you can post some code that would be helpful.

First off, try the latest phaser (and minified!). You are using a 6.1MB old version…

Then have a look at:

especially

var ball = this.physics.add.image(100, 400, ‘wizball’).setCircle(46);

Box - box collisions can stick. Box - circle almost never do.

1 Like

Thank you so much for looking at this issue and actually trying the game and seeing the problem!
I am not using a new scene but just repositioning items, creating new items and deleting older not used items.
But I have seen the problem without first getting hit and on the first maze and seen it on both Chrome and Edge on my laptop.
I am going to try and update to the latest version and then potentially try and use the circle for the shape to see if that helps. Like suggested in the next reply.
Any ideas would be great!

Also did tilt work on your iPhone?
Did the game take up the whole window?
Were you locked in landscape mode or did you play in portrait?
Thanks for any further feedback.

Thanks so much for the reply?
How did you determine the version of phaser being used?
Did you just show the source for the page?

I will take your advice and look into using the latest version minified.
I will also look at using a circle.

Wondering why box collisions would stick.
Is this a known bug?

Any further feedback would be great!

Note: I checked and the game was and is using the latest release of phaser 3 - version 3.24.1
So still not sure why this is inconsistent.

Note the collision does seem to happen - but instead of bouncing and resetting the velocity x and y for the ball, it seems the velocity x is set but y is set to zero or negative and then stays that way. The ball does keep moving but only horizontally now vertically.
Any ideas?

Yeah, I was looking at the cdn, didn’t notice you had another version below :slight_smile:

Google for ‘collision sticking site:html5gamedevs.com’. It’s a recurring problem. The more contact there is, the more chance of sticking obviously. So box/box is full contact, even worse when they are multiple pixels inside each other, and the engine does not know how to separate them.That’s why a Circle usually works better, because the point of contact is much smaller.

Nice game btw :slight_smile:

Thanks very much!
I will check out changing to a circle.

I cannot get the screen tilt to work. I even manually locked my screen rotation, but it didn’t work. The game is mostly full screen. There is a white space at the top (I played in portrait mode), and I see the browser bar.

I would also suggest some visible buttons, because it took me a while to figure out how to play- especially when I needed to move up or down. I eventually figured it out, but sometimes I would touch the screen and nothing would happen. Though once I learned the controls, it was very fun.

Thanks so much for the details.
I am not sure what to do about tilt not working.
Any ideas?

Also I am currently looking into screen size and how best to do this for different devices.
It would be nice if this just worked but I guess I have some research to do.

Not sure what I will do about the controls, if anything.

Thanks again for the feedback - it really helps.