Objective: To learn about gravity physics scripts and broadcasting. This lesson also focuses on the "repeat until" block.
Final Product:
Graphic Template: https://scratch.mit.edu/projects/382562593/ (the "see inside" button will pull up the programming interface)
Physics: The physics in this lesson is based on the first two kinematic equations from the AP Physics 1 equation sheet.
These two equations essentially relate position (where you are in space), velocity (how fast you are moving) and acceleration (how quickly you are speeding up). You can think about how this applies when are traveling in a car (position of the car, speed of the car and acceleration of the car). When you are for example traveling at a constant 55 mph down the highway, you are traveling at constant velocity and zero acceleration. When you are entering and exiting the highway you are either experience a considerable amount of acceleration or deceleration.
Gravity on earth is roughly 9.8 m/s^2 towards earth (this is why an object like a ball thrown up in the air returns to earth). The numbers I used a roughly analogous to those on earth but they don't really have the same meaning in the context of the Scratch stage. Here the positive/distance is measured in x and y coordinates. As we go over in this lecture, the dimensions of the stage are -180 to 180 in the y-direction and -240 to 240 in the x-direction. This is context in which the sprites are traveling. I encourage you to change the different values and see how that impacts the "gravity script" of the sprite.
Scripts:
![]() |
| Bounce up/bounce down loop scripts. |
Tips: Make sure that you are bouncing between the correct messages. Remember that you need to place to egg on the screen by clicking before it will bounce up and down.
Completed Program: Link


ReplyDeleteHI
This tutorial explains the concept of gravity simulation in Scratch in a simple and engaging way by combining broadcasting, variables, and looping blocks to create a realistic bouncing effect. The connection between Scratch programming and basic physics concepts such as position, velocity, and acceleration helps learners understand both coding logic and scientific principles through hands-on experimentation.
DeleteThe step-by-step implementation of gravity scripts encourages learners to explore game mechanics, animations, and event-driven programming in Scratch. Students interested in developing interactive educational applications and simulations can find more inspiration from Project Ideas for CSE Students, where programming concepts are applied to practical software projects.
Readers who wish to explore a wider range of computer science project areas and emerging technologies can also refer to Domains in Computer Engineering, which highlights diverse domains and innovative project opportunities for CSE students.
Deleteok
ReplyDeletehow to make the jump realistic
ReplyDeleteThe discussion of kinematic equations, broadcasting, and the repeat until block demonstrates how programming can be used to simulate real-world behavior. Exploring Domains in Computer Engineering can provide additional ideas for developing simulations, educational software, and interactive programming projects.
ReplyDelete