ScratchData LogoScratchData
Back to grandpasp's profile

if touching flat surface, bounce WIP

GRgrandpasp•Created May 23, 2025
if touching flat surface, bounce WIP
9
4
56 views
View on Scratch

Instructions

Some times, as well as "if on edge, bounce" we may need to "bounce" off a different surface. If we know the angle of that object, this code calculates the required bounce angle.

Description

Credit to @awesome-llama for the "difference between angles" code. Has a bug where sometimes (rarely) the ball blows through the line. It seems to happen when the ball is gliding almost parallel to the line. I haven't tracked it down yet but I'm working on it. For now, just restart it to get it back on track. I would be happy to hear suggestions. Two investigations into the potential problem: https://scratch.mit.edu/projects/1182820042 https://scratch.mit.edu/projects/1182845528 Update: I may have worked around the bug.

Project Details

Project ID1179827047
CreatedMay 23, 2025
Last ModifiedJune 1, 2025
SharedMay 23, 2025
Visibilityvisible
CommentsAllowed