ScratchData LogoScratchData
Back to mikeyaboy's profile

bouncy ball

MImikeyaboy•Created December 24, 2021
bouncy ball
1
1
6 views
View on Scratch

Instructions

i figured out how to make objects keep their velocity after being dragged. drag the object around to move it, let go and it will keep going. object bounces off walls. you can change the downward gravity level from 0-10.

Description

all code is mine :) object velocity while being dragged is measured by (current object position - old object position) for x and y this code does not run when the object is let go. bouncing happens when the object reaches the walls (x248 and y188) or (x-248 and y-188) when the object goes to any of these locations, the corresponding axis velocity gets flipped (velocity * -1)

Project Details

Project ID621073973
CreatedDecember 24, 2021
Last ModifiedJanuary 27, 2022
SharedDecember 24, 2021
Visibilityvisible
CommentsAllowed