Help with ball bounce physics


#1

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


#2

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


#3

It also got stuck on the right wall for me.


#4

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


#5

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


#6

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


#7

Thanks.


#8

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


#9

IDK how to help then let me look at code


#10

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


#11

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?


#12

Ok. Thanks for your help!


#13

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


#14

@Stylishpoopemoji33 Do you want me to code it?


#15

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.


#16

Ok.


#17

Thanks!


#18

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

#19

Ok, thanks! I will see how that works.


#20

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