# How to Make a Side-Scrolling Platformer in Scratch (Camera X & Stomp)

> Code smooth Camera X horizontal scrolling, gravity jumps, solid wall collision, and enemy stomp detection using original sprites.

Step-by-step Scratch side-scrolling platformer tutorial with Camera X, gravity physics, and enemy stomping.

## Camera X & Stomp Detection Pattern

Track worldX for every platform and enemy, render them at (worldX - camX), and check whether y velocity < 0 when touching an enemy to distinguish a stomp from side damage.

- [All 6 Popular Game Mechanics](/en/projects/popular-mechanics/): Explore more hit game systems.

**Scrolling & stomp core loop**

- set [camX] to ((camX) + (((playerWorldX) - (camX)) * (0.2)))
- level & enemy sprites: set x to ((myWorldX) - (camX))
- if <touching [Enemy]?> then if <(y vel) < (0)> then bounce & defeat else take damage

Try it: Smooth side-scrolling exploration with classic jump-on-top combat.

Updated: 2026-11-24
Author: [Takamasa Suzuki](https://scratch.gmnavi.jp/about/author/)
Japanese Edition: https://scratch.gmnavi.jp/projects/popular-mechanics/side-scroll-platformer/

[Scratch Daizen (English)](https://scratch.gmnavi.jp/en/)
