Someone. Physics. Thank you


Ok, I want to make a game, but I need a ball with Physics. Make it bounce off the edge of the screen. Also, if possible, make an ability for it bouncing off a moveable object. If not possible, take out two circles. Do not put any rules on the circles, but put rules on the ball to bounce off the circle like it could move. But one more thing:

I don't want physics where you drag the ball on the screen and it launches. I want it like a ball on a pool table with no holes. It won't move unless something else (the circle) comes in and hits it. Okay?

Credit will be given


I got it all @Hoppertoscotch! I can help a lot with this project!


I sadly don't have access to Hopscotch right now so I can't implement it, but here is how the logic of the ball bouncing off the wall could work:

You start off with two variables:

XVel is how fast it is going in the X direction, YVel is how fast it is going in the Y direction.
Then, have a rule:

When 7=7:
   Set Position to (x position)+XVel, (y position)+YVel

Now, set rules to check if the ball hits the top or bottom wall, and if it does, reverse the velocity:
If y position<6
YVel = Yvel * -1

If y position>790
YVel = Yvel * -1

And same with the two sides:

If x position<6
XVel = XVel * -1

If x position>980
XVel = XVel * -1

And bam! Thats how you make your ball bounce off the side. All you need now is to make it so that when the ball gets hi by something else, XVel or YVel get increased.


I've made that!


@SUPERSWAGGY Look at my topic again.

Also, THIS:

Things wrong:

  1. You did what I said NOT to.

  2. The ball bounces off a border YOU made, not the edge of the screen.

  1. Sorry, I misread:sweat_smile:

  2. If you check my code, there is no actual border made, it's just a bunch pf positions, so if you change them to 0,1024,0,768 they will bump the edge of the screen


@SUPERSWAGGY can you fix that?


What should I fix?


Circuits Can Not Understand.
Too Complicated.
Malnfunction. Mulnfunction.
The World Is Is Is Is Is Is Pre Pretty