GameSpark/Tutorials ← Cookbook
Cookbook · Game build

Add gravity

Gravity is one small trick — a velocity that keeps growing — and this build layers it up across three short parts. Part 1 gets a dot falling and jumping. Part 2 swaps in your own sprite and handles the offset so its feet (not its head) land on the ground. Part 3 uses sprite flags so your character stands on the platforms you painted in the Map tab. Each part is a complete program you can send straight to the editor.

1

Falling and jumping

Make something fall, land on the floor, and jump when you press space.

2

Your own sprite

Swap the circle for a sprite you drew — and land its feet, not its head.

3

Onto your tile map

Use sprite flags so your character stands on the platforms you painted.