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:

Tags: @CreationsOfaNoob @ThinBuffalo @CodeHelp @pomtl


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


It also got stuck on the right wall for me.


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


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


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




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


IDK how to help then let me look at code


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


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


Ok. Thanks for your help!


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


@Stylishpoopemoji33 Do you want me to code it?


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.






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


Ok, thanks! I will see how that works.


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