Full lesson preview

Feel the Jump: Tuning Gravity and Jump Arcs in a Platformer

STEAM50 minutesGrades: 12th
Feel the Jump: Tuning Gravity and Jump Arcs in a Platformer

Overview

Code a jump, graph the parabola and tune it from floaty to snappy.

Description

Your teen codes a jump in a free editor such as Scratch, where each frame the character's vertical speed drops by a gravity value, then models two jumps on graph paper: a floaty jump h = 8t - 4t² and a snappy jump h = 16t - 16t². They find intercepts and the peak of each parabola, test both versions with a sibling, and explain how quadratic motion and tricks like coyote time make controls feel good.

Objective

Your teen will graph quadratic functions that model jump height over time, identify their intercepts and maximum, and connect changes in the coefficients to how a game jump feels.

Standards

F-IF.7aMath · Grade HS · High School: Functions — Interpreting Functions
Graph linear and quadratic functions and show intercepts, maxima, and minima.

Materials

ItemQuantity
Computer with a web browser (Scratch is free at scratch.mit.edu)1
Sheets of graph paper2
Colored pencils (two colors)2
Calculator or phone calculator1
Ruler1

Vocabulary

Parabola
The U-shaped or upside-down-U-shaped graph of a quadratic function.
Vertex (maximum)
The highest point of a downward-opening parabola; in a jump, the peak height and the moment it happens.
Intercept
Where a graph crosses an axis; for a jump, the t-intercepts are the takeoff and landing times.
Gravity value
In game code, the amount subtracted from vertical speed every frame, which bends the jump into a curve.
Coyote time
A short grace period, often around a tenth of a second, during which a player can still jump after running off a ledge.

Preparation

Introduction

Ask your teen to jump in place twice: once like an astronaut on the Moon and once like a cartoon character snapping up and down. Tell them game designers tune exactly this difference with two numbers, and today they will see why both jumps are parabolas.
What makes a game jump feel floaty or tight when you play it?
If you throw a ball straight up, where is it moving slowest?

Steps

1Step 1
Code a basic jump
(12 min) On the computer your teen builds a Scratch sprite that jumps when the space key is pressed: set a variable vy to 12, then repeat until the sprite is back on the ground, changing y by vy and changing vy by -1 each frame. They try gravity values of -1 and -3 and describe in one sentence how each feels.
2Step 2
Graph the floaty jump
(10 min) On the first sheet of graph paper your teen builds a table for h = 8t - 4t² for t = 0, 0.25, 0.5 and so on to 2 seconds using the calculator, then plots and connects the points with the first colored pencil. They label both t-intercepts and the vertex, and write what each means in the jump.
3Step 3
Graph the snappy jump
(10 min) Using the second colored pencil on the same axes, your teen graphs h = 16t - 16t² from t = 0 to t = 1 and labels its intercepts and vertex. They compare the two parabolas: same peak height, but the snappy jump reaches it in half the time because its gravity coefficient is four times larger and its starting speed is twice as large.
4Step 4
Playtest floaty vs snappy
(8 min) Your teen sets the Scratch jump to a floaty version (vy 10, gravity -0.5) and a snappy version (vy 14, gravity -2), and a sibling or parent plays each for a minute hopping over one obstacle. Your teen records which one the tester preferred and why on the second sheet of graph paper.
5Step 5
Solve and explain
(10 min) Your teen works the Practice Problems on the second sheet of graph paper, then checks with the Answer Key. They finish by explaining to you, in a few sentences, what coyote time does and why designers add it even though it breaks real physics.

Conclusion

Ask your teen: if a designer wants a jump that is twice as high but takes the same time, what do they change? A strong answer mentions both the starting speed and the gravity number, because the peak height is v²/(2g) and the time to the peak is v/g.

Make your own lesson plan in minutes

Describe a topic and Resource Portal AI writes the objectives, materials and steps for your group.

Try Resource Portal AI