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

Start learning →

60 Essential Scratch Game Mechanics & How to Code Them

📌 What you will learn

Master 60 reusable Scratch game mechanisms—from hitboxes, scrolling cameras, timers, and lives to combo multipliers, save codes, and single-tick engines.

Browse All 60 Game Mechanisms

Every great game combines a handful of clean, reusable mechanics. Pick any mechanism below to learn both how it works and why it stays bug-free.

Accurate Hit Detection & Hitbox Swapping Separate visual costumes from rectangular collision hitboxes for fair hits. Learn more → Horizontal Scrolling Camera (Camera X) Keep the player centered while scrolling wide stages with (worldX - camX). Learn more → Vertical Scrolling Camera (Camera Y) Build tower climbers and vertical space shooters with Camera Y tracking. Learn more → Countdown Round Timer & Time-Up Trigger Count down seconds cleanly and broadcast time-up at zero. Learn more → Extra Lives & Respawn System Decrement lives on hit, respawn safely, and trigger game over at 0. Learn more → Multi-Level Stage Progression (Level 1 -> 2 -> 3) Advance levels with a level variable and a single load-level broadcast. Learn more → Fair Random Spawning (Avoid Clustering) Re-roll spawn x positions that land too close to the previous spawn. Learn more → Hit Combo Score Multiplier Scale score rewards on rapid hits and reset when the combo timer expires. Learn more → Impact Knockback & Recoil Physics Push sprites away from the attacker with directional x and y velocity. Learn more → Camera Screen Shake on Explosions & Hits Apply brief random camera offsets for punchy arcade feedback. Learn more → Invincibility Frames (i-Frames) & Blinking Protect the player for 1 second after damage with ghost-effect flashing. Learn more → Wall Slide & Wall Kick Platformer Mechanic Cap falling speed against walls and launch diagonally on jump press. Learn more → Slippery Ice Floor & Surface Friction Switch horizontal friction coefficients between 0.78 (normal) and 0.95 (ice). Learn more → Hold-to-Charge Power Shot Increment a charge variable while holding space and fire scaled shots on release. Learn more → Corner Minimap & Live Radar Scale world coordinates by 1/12 to plot live positions inside a HUD box. Learn more → Copyable Save Code (Password System) Encode level and coins into a joined string so players can resume anytime. Learn more → Clean Pause & Resume Toggle Skip movement, AI, and timers cleanly while paused = 1. Learn more → Dynamic Difficulty Scaling Curve Shorten spawn delays as score climbs while enforcing a fair minimum cap. Learn more → Ability Cooldown Timer Prevent special-move spam with a ticking cooldown variable. Learn more → Stamina Drain & Auto-Regeneration Drain stamina during sprints and regenerate smoothly while walking. Learn more → Ammo Counter & Timed Reloading Track remaining shots and pause briefly to reload at zero. Learn more → Breakable Energy Shield (Hit Counter) Absorb 3 hits on shield durability before HP takes damage. Learn more → Smooth Curved Homing Steering Turn gradually toward target angles each frame for realistic missiles. Learn more → Progressive Enemy Wave Director Monitor enemies-remaining and launch escalating waves automatically. Learn more → Multi-Phase Boss Fight (50% HP Shift) Trigger faster attacks and visual changes when boss HP drops below half. Learn more → Weighted Enemy Loot Drop Table Roll 1–100 to drop coins, hearts, or rare power-ups on defeat. Learn more → Tiered Upgrade Shop (Lv1 -> Lv5) Scale upgrade cost and power cleanly with each level purchased. Learn more → List-Based Item Inventory & Consumption Add picked-up items to a list and delete on use to trigger effects. Learn more → 2-Ingredient Crafting System Check list membership for two materials and craft a new item. Learn more → Branching Choice Dialogue System Wire player choice buttons to distinct story broadcasts and flags. Learn more → 4-State Quest Tracker (Available -> Complete) Track quest status (0–3) and objective counters cleanly. Learn more → In-Game Day/Night Clock & Lighting Cycle time 0–24 with brightness shifts and nighttime spawns. Learn more → Dynamic Weather System (Sun / Rain / Snow) Switch weather states periodically with matching particles and friction. Learn more → Real-Time Clock & Day-of-Week Events Use sensing current hour/day blocks for morning and weekend greetings. Learn more → Speed-Based Turn Order Queue Compare agility stats to decide who acts first each RPG turn. Learn more → Tile-Snapped Grid Movement (32px Steps) Move smoothly in 8×4px increments locked to a clean tile grid. Learn more → Sokoban Crate-Pushing Collision Check one tile beyond the crate before moving player and crate together. Learn more → Multi-Switch & Linked Door System Use a door-state list (0/1) so each color switch controls its matching door. Learn more → Conveyor Belt Moving Floor Add constant horizontal push whenever the sprite touches belt tiles. Learn more → Trampoline / Spring Bounce Pad Set high upward y-velocity and play a bounce animation on contact. Learn more → Crumbling Platform with Respawn Shake for 0.6s, hide collision, and reappear after 3 seconds. Learn more → Circular & Ping-Pong Trap Paths Drive spinning hazards along sin/cos circles or linear tracks. Learn more → Two-Way Warp Portal with Cooldown Prevent infinite teleport loops with a 0.5-second warp lock. Learn more → Mid-Level Checkpoint Flag Overwrite respawnX and respawnY when passing a checkpoint banner. Learn more → Time-Attack Ghost Replay System Record best-run x/y lists and replay them as a translucent ghost sprite. Learn more → Smooth Lerp Camera Zoom Ease zoom scale toward a target multiplier for dramatic scenes. Learn more → Multi-Layer Parallax Depth Scrolling Scroll sky at 0.2×, hills at 0.5×, and foreground at 1.0× camera speed. Learn more → Gravity Particle Burst & Confetti Give cloned particles random vx/vy and fade ghost effect to 100. Learn more → Floating Damage Number Popups Float cloned hit numbers upward while fading out over 0.5s. Learn more → Custom Stamped Sprite Score Counter Stamp 0–9 digit costumes inside a no-refresh custom block. Learn more → Single-Pen Smooth Health Bar Draw a gray track and proportional green fill bar with zero costumes. Learn more → Typewriter Dialogue with Voice Blips Play a short blip on every non-space character revealed. Learn more → Automatic Line-Wrapping Text Renderer Reset x and drop y when line character count exceeds the box width. Learn more → Undo History Stack Using a List Push state snapshots before each move and pop the last entry on Undo. Learn more → Weighted Rarity Probability Rolls Use clean cumulative thresholds (1–3 Rare, 4–18 Uncommon, 19–100 Common). Learn more → No-Duplicate Deck Draw System Delete drawn indices from a working list for guaranteed unique draws. Learn more → Separate BGM & SFX Volume Channels Isolate music and sound effects on separate sprites for independent sliders. Learn more → On-Screen Touch Controls for Tablets Combine touch button variables with keyboard keys via OR blocks. Learn more → Delta-Time Sync (30 FPS & 60 FPS Safe) Multiply speeds by timer delta so games feel identical in Scratch & TurboWarp. Learn more → Single Tick Broadcast Game Engine Order movement, collision, camera, and rendering from one master loop. Learn more →

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