Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How should I make a ball bounce off a ball
- sullydux
-
8 posts
How should I make a ball bounce off a ball
How should I make a ball bounce off a ball, I know how to make it bounce off flat surfaces. I'm trying to make pool.
Heres the project link. https://scratch.mit.edu/projects/942224223
Heres the project link. https://scratch.mit.edu/projects/942224223
Last edited by sullydux (Dec. 24, 2023 12:05:05)
- RethinkingVoxels
-
1000+ posts
How should I make a ball bounce off a ball
do you want to bounce off like the
block?
- nowayoryesway
-
19 posts
How should I make a ball bounce off a ball
maby he meant this (a LOT of blocks here)
- deck26
-
1000+ posts
How should I make a ball bounce off a ball
Imagine a line joining the centres of the two balls. Now imagine a line perpindicular to that and treat that line as a flat surface you're bouncing off - that's a reasonable starting point. But it's not that simple really - if you hit a ball some or all of the momentum may be transferred to the target ball - so all you have is the angle the ball will move if it bounces off another ball but calculating the speed involves a lot more work. Presumably some sort of conservation of momentum calculations are required.
Of course this also ignores things like putting spin on the cue ball to affect how it moves.
Of course this also ignores things like putting spin on the cue ball to affect how it moves.
- sullydux
-
8 posts
How should I make a ball bounce off a ball
yea do you want to bounce off like theblock?
Last edited by sullydux (Dec. 24, 2023 12:04:13)
- sullydux
-
8 posts
How should I make a ball bounce off a ball
Your project “Bounce Angle On Flat Surface” help a lot because I could not figure out how to bounce a ball on a flat surface. Imagine a line joining the centres of the two balls. Now imagine a line perpindicular to that and treat that line as a flat surface you're bouncing off - that's a reasonable starting point. But it's not that simple really - if you hit a ball some or all of the momentum may be transferred to the target ball - so all you have is the angle the ball will move if it bounces off another ball but calculating the speed involves a lot more work. Presumably some sort of conservation of momentum calculations are required.
Of course this also ignores things like putting spin on the cue ball to affect how it moves.
Would that figure out what the surface angle is on the ball where the other ball hits it
- deck26
-
1000+ posts
How should I make a ball bounce off a ball
The line I described will be a tangent to both balls - it forms a right angle with the radius of both circles. So it tells you where the contact point is and is, I think, essentially the same as a flat surface for the bounce calculation.
This project https://scratch.mit.edu/projects/174551399/ demonstrates this.
This project https://scratch.mit.edu/projects/174551399/ demonstrates this.
- RethinkingVoxels
-
1000+ posts
How should I make a ball bounce off a ball
simple (kinda)yea do you want to bounce off like theblock?
put this script in both sprites
Last edited by RethinkingVoxels (Dec. 24, 2023 13:39:21)
- deck26
-
1000+ posts
How should I make a ball bounce off a ball
Have you actually tried that? Doesn't have anything to do with the question. It seems to assume that the natural bounce depends on which edge of the screen the ball would hit if it kept going in its current direction. Do you really think the bounce angle is the same no matter where it hits another ball?simple (kinda)yea do you want to bounce off like theblock?put this script in both sprites
- RethinkingVoxels
-
1000+ posts
How should I make a ball bounce off a ball
yea, i've tried it. it answered what the question was, “How to make a ball bounce off eachother”, they said they wanted it to be like the “if on edge, bounce” block, so i made the solution.Have you actually tried that? Doesn't have anything to do with the question. It seems to assume that the natural bounce depends on which edge of the screen the ball would hit if it kept going in its current direction. Do you really think the bounce angle is the same no matter where it hits another ball?simple (kinda)yea do you want to bounce off like theblock?put this script in both sprites
- sullydux
-
8 posts
How should I make a ball bounce off a ball
thanks The line I described will be a tangent to both balls - it forms a right angle with the radius of both circles. So it tells you where the contact point is and is, I think, essentially the same as a flat surface for the bounce calculation.
This project https://scratch.mit.edu/projects/174551399/ demonstrates this.
- sullydux
-
8 posts
How should I make a ball bounce off a ball
i needed it like one bounce block with a drop downyea, i've tried it. it answered what the question was, “How to make a ball bounce off eachother”, they said they wanted it to be like the “if on edge, bounce” block, so i made the solution.Have you actually tried that? Doesn't have anything to do with the question. It seems to assume that the natural bounce depends on which edge of the screen the ball would hit if it kept going in its current direction. Do you really think the bounce angle is the same no matter where it hits another ball?simple (kinda)yea do you want to bounce off like theblock?put this script in both sprites
Last edited by sullydux (Dec. 25, 2023 11:34:26)
- sullydux
-
8 posts
How should I make a ball bounce off a ball
The line I described will be a tangent to both balls - it forms a right angle with the radius of both circles. So it tells you where the contact point is and is, I think, essentially the same as a flat surface for the bounce calculation.
Never mind
Last edited by sullydux (Dec. 25, 2023 17:37:18)
- Discussion Forums
- » Help with Scripts
-
» How should I make a ball bounce off a ball