NEW Explore the Scratch Block Dictionary, tutorials, textbook, and classroom guides

Start learning →

change x by (10) — Scratch Block Guide

📌 What you will learn

Shifts the sprite horizontally by the given amount (positive = right, negative = left) regardless of direction.

What this block does

Shifts the sprite horizontally by the given amount (positive = right, negative = left) regardless of direction.

The standard block for crisp left/right keyboard controls in platformers and arcade games.

  • Category: Motion Blocks
  • Key tip: Unlike "move steps", "change x by" never drifts diagonally if the sprite rotates.

Working Scratch example

Try building this small script in the Scratch editor, predict what will happen, then click the green flag to test it.

Example using change x by (10)
  1. When green flag clicked
  2. Forever
  3. If key (right arrow) pressed? then
  4. Change x by 6

Try it: Holding the right arrow slides the sprite right at 6 pixels per frame.

Related block guides

Explore other blocks in the same category or return to the full English Block Dictionary.

Back to Motion Blocks See the overview and patterns for Motion Blocks. Learn more → Scratch Block Dictionary (All Categories) Browse Motion, Looks, Sound, Events, Control, Sensing, Operators, Variables, and Extensions. Learn more →

FAQ

When should I use "change x by (10)" in Scratch?

The standard block for crisp left/right keyboard controls in platformers and arcade games. Unlike "move steps", "change x by" never drifts diagonally if the sprite rotates.

This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.