# Help with ball bounce physics

I’m working on a game called Clask, with many of you know. If you play the game for a while, you might notice that the ball gets stuck on the left wall, and seems to be bouncing against nothing. I am utterly mystified and don’t know what to do. Can anyone help? Latest version:

13 Likes

First post

I think you need to make it flip or rotate 180 degrees when it hits a will and to just increase the ball’s movement in general

4 Likes

It also got stuck on the right wall for me.

2 Likes

I can check it out soon. I can’t right now. (Dang it, I wanted first post.)

2 Likes

Ok. I will make sure to add that. Any ideas?

4 Likes

There are multiple ways of doing it, but the way I would do it is take your current rotation, multiply it by 2, and turn by - answer

3 Likes

Thanks.

3 Likes

I have the physics down, it’s just being weird for some reason.

2 Likes

IDK how to help then let me look at code

2 Likes

Everything seems normal apart from the ball and AI getting stuck in the right edge.

2 Likes

What if you put a conditional for if the ball’s X position is Width = 1024 or 0, you made the ball’s X position be like Width - 50 and for the left wall it could be just 50?

2 Likes

Ok. Thanks for your help!

2 Likes

That’s ok. Thanks for looking at the code! It’s pretty complicated…

2 Likes

@Stylishpoopemoji33 Do you want me to code it?

2 Likes

Maybe. Do you want to try and see if it works? You can remix it and I will give you credit for help with ball bounce code.

2 Likes

Ok.

2 Likes

Thanks!

2 Likes

Ok @Stylishpoopemoji33, here is what I recommend

1. Change your collision to sominging like
If dist. Between ball and black thingy < black thingy radius
2. Do what @Hopscotcher said for bouncd
3 Likes

Ok, thanks! I will see how that works.

2 Likes

K sounds good. ( I have no likes left…)

2 Likes