In this lesson you will build a gravity system that can be used in video games. When a character jumps, they will move in the air 10 spaces then gravity will pull them back to the ground
- Original Author: Wade Gemmell
- Education Level: Preschool and Kindergarten, Elementary School, Middle School, High School, College and University, Professional Development, Other
- Content Types: Activity, Handout, Lesson Plan
- Curricular Areas: Computer Science, Engineering, Language Arts, Mathematics, Music, Science, Social Studies, Teacher Education, Technology, Visual Arts, Other
- Keywords: loops, game, animation, physics, intermediate, advanced, algorithm, gravity
In this lesson you will build a gravity system that can be used in video games. When a character jumps, they will move in the air 10 spaces then gravity will pull them back to the ground. In other examples we have used keyboard control blocks to send a message to move a character up and down. This is NOT what we will do with this program. In this example, we will use a process called “looping” that will do this for us automatically. While this is much more difficult to program (and understand) it is much more realistic and gives a game a more natural feel.