How to Make a Platformer Game in Scratch (AI Exit)

By Arron R.8 min read
How to make a platformer game in Scratch starts with separate gravity, ground, and jump scripts on one screen. When you need a browser ship path, copy that feel

Most Scratch platformers fail on feel, not on missing levels. The jump floats, the ground flag flickers, or death dumps the player into an unclear restart. Start with a smaller contract: fall, stand, jump, die, and respawn on one screen. This guide covers how to make a platformer game in Scratch with separate gravity, ground, and jump scripts, then shows when to port that same contract into a browser build with WizardGenie, Quick Sprites, and SFX Gen. Scratch product facts below were verified against the official About Scratch page on July 21, 2026. Phaser version facts were verified against phaser.io the same day.

How to make a platformer game in Scratch workflow from feel contract to WizardGenie browser exit
A shippable Scratch platformer begins as jump numbers, becomes separate scripts, then graduates to a browser loop with readable sprites and short feedback sounds.

What how to make a platformer game in Scratch must teach first

The primary query how to make a platformer game in scratch has 1,900 monthly searches and KD 0 in the DataForSEO-backed research-supplement.md, verified July 21, 2026. Close siblings such as how to make a platformer scratch and how to make a platformer in scratch share the same volume band. Readers typing those phrases usually want block scripts that make a character run and jump on platforms, not a genre essay.

Scratch is a free creative coding environment from the Lifelong Kindergarten Group at the MIT Media Lab, designed especially for ages 8 to 16 and used in more than 150 countries. It is excellent for learning variables, sensing, and forever loops. A platform game is defined by traversal across suspended ground, with jumping as the central skill. For a first Scratch prototype, translate that into six written fields before any fancy costumes:

  • Run speed: how many steps per frame while left or right is held.
  • Jump impulse: the upward change to the vertical velocity variable when a jump starts.
  • Gravity: the downward change applied every frame while airborne.
  • Grounded flag: a boolean that becomes true when the feet touch a platform color or sprite.
  • Max fall speed: a clamp so long drops stay readable.
  • Hazard rule: what kills the player and where respawn restores control.

If you cannot fill that card, keep designing. A project that only says “make a fun platformer” will invent a different jump on every remix.

Build gravity, ground, and jump as separate scripts

The core mistake in how to make a platformer game in Scratch is stuffing move, fall, and jump into one forever stack. Split them so each forever loop owns one rule.

Gravity script: if not grounded, change vy by a small positive amount (down), clamp to max fall speed, then change y by vy. Do not apply gravity while grounded or the character will vibrate into the floor.

Ground script: sense the platform with color touching or sprite touching under the feet. When contact is true, set grounded to true, set vy to 0, and snap y up a pixel so the costume does not sink. When contact is false, set grounded to false. Keep the sensing hitbox at the feet, not the whole costume, or hair pixels will count as ground.

Jump script: when the jump key is pressed and grounded is true, set vy to a negative impulse. Optional coyote time: keep a short timer after leaving a ledge during which jump still works. Optional jump buffer: remember a premature press for a few frames and fire on the next grounded edge.

Horizontal move stays in a fourth forever loop: if right arrow, change x by run speed; if left, change x by negative run speed. Wall bumps can use the same color sensing as floors, but finish floor feel before wall slides.

Separate Scratch gravity, ground, and jump scripts for a platformer feel contract
One forever loop per rule makes floaty jumps and false landings obvious instead of hiding them in a single mega-stack.

Add scrolling and simple hazards

Only after a five-minute playtest on a fixed stage should you add scroll. A practical Scratch pattern is to move the backdrop or platform sprites opposite the player once the player crosses a screen center threshold. Keep the player’s on-stage x mostly stable while the world slides. If both player and world move freely, camera math will fight your ground sensing.

Hazards should be boring and reliable. Spikes or pits set a hurt state, disable controls briefly, play a short sound later, and go to a spawn x/y. Do not rebuild the entire stage on every death unless you are intentionally testing costume load. A respawn that reallocates platforms will hide collision bugs behind loading noise.

Enemy patrols can wait. A moving platform is enough stress for the second lesson: grounded must stay true while riding, and leaving the platform edge must clear grounded cleanly. If the player sticks to the side of a platform, shrink the side hit test or only accept ground when the feet are above the platform top.

When Scratch stops fitting the next ship target

Scratch remains the right classroom for how to make a platformer game in Scratch. Exit when your next goal is outside what block projects are built to ship. Common triggers:

  • You need ordinary PNG sprite sheets and frame metadata instead of costume packs.
  • You want frame-timed coyote and buffer windows that stay stable across machines.
  • You need to host a share link on itch, GitHub Pages, or a jam site that expects a browser build.
  • Art and audio iteration is slower than the feel iteration you already finished.

Do not throw away the Scratch project. Export or screenshot the feel card: run speed, jump impulse, gravity, max fall, hazard rule, and spawn point. That card is the product. The AI exit rebuilds the product on a different runtime; it does not invent a new genre.

Port the same feel contract into WizardGenie

Open WizardGenie on desktop or web. Lead with the contract, not the theme. A useful first prompt is:

Build a browser side-view platformer on one screen. Player run speed 160, jump velocity -420, gravity 1200, max fall speed 600, coyote time 100 ms, jump buffer 100 ms. Use axis-aligned boxes for the player and platforms. Include left/right and jump on keyboard, a grounded flag, coyote and buffer timers, one spike hazard that respawns the player at a marked spawn, and a small debug strip showing grounded, coyote remaining, and buffer remaining. Use colored rectangles only. No inventory, no enemy AI, no menu.

WizardGenie writes, runs, and iterates on the game in real time. Bring your own API key or use the trial path exposed in the product. Model choices in the current Sorceress catalog include Claude Opus 4.7, Claude Sonnet 4.6, GPT-5.5, Gemini 3.1 Pro, DeepSeek V4 Pro, Kimi K2.5, Grok 4.2, and MiniMax M2.7. Prefer a strong planner for the first scaffold and a cheaper fast model for tiny feel tweaks so iteration stays cheap. Never put a frontier-priced model on every micro edit.

If you want Phaser specifically, pin a real version. As of July 21, 2026, the stable release on phaser.io/download/stable is Phaser v4.2.1 “Giedi” (released July 9, 2026). Name that version in the prompt when you care about Arcade Physics body behavior. Axis-aligned box checks are enough for this stage; MDN’s guide to 2D collision detection covers AABB overlap as the practical default for rectangles that do not rotate.

A longer browser-first sibling lives at how to make a platformer in the browser if you already finished Scratch and only need the AI loop. The Sorceress tools guide lists adjacent asset tools, but this exit path only needs the three featured tools below.

WizardGenie browser platformer using the same Scratch feel contract with sprites and SFX
Port the numbers first. Art and audio come after the gray box matches the Scratch jump you already trust.

Replace placeholders with sprites and SFX

Only after the gray box matches your Scratch feel card should you replace rectangles. Open Quick Sprites and generate a small player set: idle, walk, jump, fall. Keep the silhouette family identical across those frames. Then generate one hazard family with a taller, sharper outline than the player so threat reads before contact.

A practical player prompt is “16-bit side-view adventurer, readable silhouette, idle walk jump fall, transparent background, game sprite sheet, no text.” A practical hazard prompt is “16-bit metal spike cluster, sharp triangular silhouette, transparent background, single frame.” Export the sheet, then verify each frame at the on-screen pixel size you actually use.

Open SFX Gen and generate three short cues: jump (soft rising tick), land (low thud under 200 ms), and hurt (sharp hit without long reverb). Keep them dry. Wire sounds to state transitions, not raw button presses: jump audio fires when the impulse is applied, land audio on the grounded false→true edge after a fall, hurt audio once when death lockout begins.

Playtest the exit build like a Scratch remix checklist

Finish with a written matrix that works for both Scratch and the browser exit:

  • Walk off a ledge and press jump within coyote time — must jump.
  • Walk off a ledge and press jump after coyote expires — must fail.
  • Press jump slightly before landing — buffer must fire on touch.
  • Touch a spike — controls lock, spawn restores, and hurt plays once.
  • Respawn — velocity and camera restore without a stuck hurt state.

Run the matrix after every costume or sprite swap. Visual changes often alter perceived contact points even when numbers stay fixed. If players still miss jumps that the matrix says are legal, shorten the gap before blaming the player.

That is the complete path for how to make a platformer game in Scratch and then leave cleanly: learn the feel in blocks, write the contract down, and rebuild the same contract where browser shipping and asset iteration are faster. Everything else is content.

Common issues when learning how to make a platformer game in Scratch

  • Character vibrates on the floor: gravity is still applying while grounded. Zero vy and skip gravity on grounded frames.
  • Jump feels floaty: raise gravity or lower jump impulse, changing only one variable per test.
  • Hair or hat counts as ground: move the ground sensor to the feet and shrink the sensing box.
  • Scroll breaks jumps: freeze player screen-x and move the world, or re-test grounded after every scroll step.
  • Browser port feels different: you changed numbers during the rebuild. Paste the Scratch card into the WizardGenie prompt verbatim and only then tune.

Frequently Asked Questions

What is the first step for how to make a platformer game in Scratch?

Write a feel contract before costumes: fall speed, jump impulse, ground detection, and what kills the player. Build gravity, grounded checks, and jump as separate forever scripts so you can debug one variable at a time on a single screen.

Why separate gravity and jump scripts in Scratch?

Combined scripts hide which rule failed. Gravity always pulls when not grounded, ground sensing sets a grounded flag, and jump only fires when grounded or during a short coyote window. Separating those blocks makes floaty jumps and false landings easy to fix.

When should I leave Scratch for a browser AI platformer?

Exit when you need precise frame timing, ordinary sprite sheets, itch or GitHub Pages hosting, or faster art and audio iteration than costume packs allow. Keep the same run, jump, gravity, and hazard numbers and rebuild them in WizardGenie instead of inventing a new game.

Which Sorceress tools replace Scratch costumes and sounds?

Quick Sprites generates readable player and hazard frames with transparent backgrounds. SFX Gen adds short jump, land, and hurt cues. WizardGenie writes and runs the browser loop so those assets plug into a playable stage without reinstalling an IDE.

Do I need Phaser to finish how to make a platformer game in Scratch and then leave?

No. Scratch teaches the feel. For the browser exit, pin a real runtime when physics matter. As of July 21, 2026, Phaser v4.2.1 Giedi is the stable release on phaser.io. Name that version in WizardGenie prompts if you care about Arcade Physics body behavior.

Sources

  1. About Scratch — Scratch Help
  2. Platform game — Wikipedia
  3. 2D collision detection — MDN Web Docs
  4. Download Phaser v4.2.1 — Phaser
Written by Arron R.·1,723 words·8 min read

Related posts