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

Start learning →

if on edge, bounce — Scratch Block Guide

📌 What you will learn

Reverses the sprite’s angle automatically whenever it touches any of the four stage edges.

What this block does

Reverses the sprite’s angle automatically whenever it touches any of the four stage edges.

Great for patrolling enemies, Pong balls, and screensaver animations.

  • Category: Motion Blocks
  • Key tip: This block only works with "move steps"—it does not reverse manual "change x/y" scripts.

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 if on edge, bounce
  1. When green flag clicked
  2. Point in direction 45
  3. Forever
  4. Move 6 steps
  5. If on edge, bounce

Try it: The sprite bounces diagonally around the entire stage endlessly.

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 "if on edge, bounce" in Scratch?

Great for patrolling enemies, Pong balls, and screensaver animations. This block only works with "move steps"—it does not reverse manual "change x/y" scripts.

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