Scratch 逆向实战词典 — Scratch How-To Reverse Lookup Dictionary (120 Recipes)
📌 本页学习重点
先用最少积木跑通核心效果,再逐步调整速度、音效与关卡难度。 Find the exact Scratch blocks by what you want to build—jumping, chasing enemies, scores, timers, animations, lists, sound, and debugging (120 guides).
核心思路与实现步骤: Look Up Scratch Blocks by Your Goal (120 Guides)
先用最少积木跑通核心效果,再逐步调整速度、音效与关卡难度。
Don’t remember the block name? Start from what you want your project to do and jump straight to the minimal working block recipe.
How to Make a Character Jump with Gravity Use a y-velocity variable and constant gravity pull for smooth parabolic jumping. 查看详情 → How to Add a Double Jump in Scratch Track remaining jumps in a variable so the player can jump once more mid-air. 查看详情 → How to Move a Sprite Smoothly Left and Right Check key presses inside a forever loop instead of using choppy hat-block repeats. 查看详情 → How to Move a Sprite in 4 Directions (Top-Down) Combine up/down y changes and left/right x changes for mazes and RPGs. 查看详情 → How to Make a Sprite Follow the Mouse Pointer Point toward the mouse and move only when the distance is greater than 10. 查看详情 → How to Add a Dash or Sprint Button Switch a speed variable between normal walk speed and fast sprint speed. 查看详情 → How to Flip a Sprite Left/Right Without Going Upside Down Set rotation style to left-right and alternate between 90° and -90°. 查看详情 → How to Stop a Sprite from Walking Through Walls Immediately undo the last movement step if the sprite touches a wall. 查看详情 → How to Create Slippery Ice Floor Physics Multiply x-velocity by a friction factor like 0.92 every frame. 查看详情 → How to Make a Ball Bounce Off Stage Edges Combine move steps with the built-in if-on-edge-bounce block. 查看详情 → How to Wrap Around from One Edge of the Screen to the Other Teleport x from >240 to -240 and vice versa for classic arcade wrap-around. 查看详情 → How to Climb Up and Down Ladders Disable gravity while touching a ladder and move vertically with up/down keys. 查看详情 → How to Add Knockback When Hit by an Enemy Compare x positions and push the player away from the enemy. 查看详情 → How to Make a Sprite Draggable with the Mouse Use set drag mode draggable or track mouse-down inside a repeat-until loop. 查看详情 → How to Aim and Shoot Projectiles Toward the Mouse Clone a bullet at the player, point it toward the mouse, and move until edge. 查看详情 → How to Make an Enemy Chase the Player Point the enemy toward the player sprite and step forward each frame. 查看详情 → How to Make an Enemy Patrol Back and Forth Turn 180 degrees whenever the enemy crosses left or right patrol limits. 查看详情 → How to Spawn Enemies at Random Positions Pick random coordinates before creating each clone. 查看详情 → How to Create a Smooth Homing Missile Gradually steer direction toward the target instead of snapping instantly. 查看详情 → How to Switch Between Multiple Boss Attack Patterns Use a state variable to cycle through dash, spread shot, and pause phases. 查看详情 → How to Add Invincibility Frames (i-Frames) After Damage Set an invincible flag to 1 and blink ghost effect for 1 second. 查看详情 → How to Build a Clean Rectangle Hitbox Switch temporarily to a rectangular hitbox costume during collision checks. 查看详情 → How to Defeat Enemies by Jumping on Top of Them Check whether y-velocity is negative (falling) at the moment of contact. 查看详情 → How to Detect When the Player Enters Enemy Vision Range Activate chase mode only when distance to player drops below a threshold. 查看详情 → How to Add a Shield Block Button Set a blocking variable to 1 while held and ignore damage while blocking. 查看详情 → How to Add Random Critical Hits Roll a 1-in-5 random number to deal double damage. 查看详情 → How to Build a Hit Combo Multiplier Increment combo on each hit and reset to 0 after a short timeout. 查看详情 → How to Create Explosion Area-of-Effect (AoE) Damage Broadcast explosion and damage all enemy clones within distance < 80. 查看详情 → How to Give Each Enemy Clone Its Own Independent HP Create an "enemy HP" variable with "For this sprite only" selected. 查看详情 → How to Spawn Enemies in Progressive Waves Watch enemies-remaining and start the next wave when it hits 0. 查看详情 → How to Add a Score Counter Reset score to 0 on green flag and change by +10 on item pickup. 查看详情 → How to Track a High Score Update high score whenever the final score exceeds the stored record. 查看详情 → How to Create a Countdown Timer Start at 30 seconds, wait 1 second per tick, and broadcast time-up at 0. 查看详情 → How to Measure Exact Clear Time with Decimals Reset the built-in sensing timer at start and record it at the finish line. 查看详情 → How to Display a Visual Health (HP) Bar Switch bar costumes based on current HP or draw with the Pen extension. 查看详情 → How to Show a Game Over Screen with Retry Broadcast game-over to stop loops, swap backdrop, and show a retry button. 查看详情 → How to Advance to the Next Level on Stage Clear Increment a level variable and broadcast start-level to load the next stage. 查看详情 → How to Build a Title Screen and Start Button Show title art on green flag and broadcast start-game when Play is clicked. 查看详情 → How to Add a Pause / Resume Toggle Skip movement updates whenever a paused variable equals 1. 查看详情 → How to Add Easy / Normal / Hard Difficulty Buttons Set enemy speed and spawn delay variables before broadcasting start. 查看详情 → How to Keep a Top-5 Score Leaderboard in a List Insert each new score in sorted order and trim anything past item 5. 查看详情 → How to Build an XP & Level-Up System When XP reaches the threshold, increase Level and boost stats. 查看详情 → How to Create an In-Game Coin Shop Verify coins >= price before deducting coins and adding the item to inventory. 查看详情 → How to Pop Up Achievement Unlock Banners Trigger a one-time notification flag when a milestone is reached. 查看详情 → How to Generate a Copyable Save Code (Password) Join level and coin values with a separator so players can resume later. 查看详情 → How to Animate a Walking Character Cycle costumes every 0.1 seconds only while a movement key is held. 查看详情 → How to Fade Sprites In and Out Smoothly Step the ghost effect from 100 down to 0 over 10 frames. 查看详情 → How to Add Screen Shake on Impacts Offset camera/background x and y randomly for a few short frames. 查看详情 → How to Spawn Sparkle or Smoke Particles Clone tiny dots that fly outward while fading ghost effect to 100. 查看详情 → How to Display RPG Typewriter Text One Letter at a Time Append one character per loop into a display variable. 查看详情 → How to Sync a Two-Character Conversation Use broadcast-and-wait between lines so timing never drifts. 查看详情 → How to Create an Endless Scrolling Background Place two background sprites side by side and recycle each at x < -480. 查看详情 → How to Add Parallax Depth with Multi-Speed Layers Scroll distant hills slowly (-1) and foreground ground faster (-5). 查看详情 → How to Transition from Day to Sunset and Night Gradually adjust backdrop brightness effect over time. 查看详情 → How to Make Rain or Snow Fall Across the Stage Clone droplets at random top x positions and delete them at the bottom. 查看详情 → How to Leave a Glowing Trail Behind a Moving Sprite Clone behind the sprite and shrink while increasing ghost effect. 查看详情 → How to Grow Menu Buttons on Mouse Hover Scale to 110% while touching mouse-pointer and 100% otherwise. 查看详情 → How to Render Custom Sprite Digits Instead of Variable Monitors Stamp 0–9 digit costumes for each character of the score string. 查看详情 → How to Draw a Corner Minimap Scale world coordinates by 0.1 and plot a small dot in the corner. 查看详情 → How to Create a Flashlight / Dark Room Spotlight Effect Keep a large black sprite with a transparent center hole centered on the player. 查看详情 → How to Play an Opening Cutscene Before Gameplay Broadcast-and-wait for the intro sequence before starting the main game loop. 查看详情 → How to Clear a Speech Bubble Immediately Run a "say ()" block with an empty text input. 查看详情 → How to Fix Sprites Hiding Behind UI or Background Explicitly send UI to front layer and decorative scenery to back layer. 查看详情 → How to Zoom In and Out on a Scene Multiply sprite size and offset distance from camera center by a zoom factor. 查看详情 → How to Flash an Enemy White on Hit Spike brightness effect to 80 for 0.08 seconds, then reset to 0. 查看详情 → How to Loop Background Music Seamlessly Use "play sound until done" inside a forever loop—never "start sound". 查看详情 → How to Switch Music Tracks Between Title and Battle Stop other scripts in the music sprite and stop all sounds before starting the new loop. 查看详情 → How to Add a Mute / Unmute Audio Button Toggle volume between 0% and 100% when clicked. 查看详情 → How to Raise Sound Pitch as Combo Increases Set pitch effect proportional to the current combo count. 查看详情 → How to Make Characters Speak Out Loud (Text-to-Speech) Add the Text-to-Speech extension to read dialogue or quiz questions aloud. 查看详情 → How to Compose Original Melodies with the Music Extension Choose an instrument, set tempo, and sequence MIDI note numbers. 查看详情 → How to Fix Buzzing or Distorted Sound Effects Wait until the trigger condition ends before allowing the sound to play again. 查看详情 → How to Play Footstep Sounds Only While Moving Check a moving flag in a separate loop with a 0.25-second step interval. 查看详情 → How to Fade Out Music Smoothly at Level End Lower volume by -10 ten times, stop all sounds, then restore volume to 100%. 查看详情 → How to Sync Visual Pulses to a Song BPM Calculate beat length as 60 / BPM and compare against the timer. 查看详情 → How to Build a 10-Question Quiz Using Lists Store questions and answers in parallel lists and step through by index. 查看详情 → How to Pick Random Items Without Repeats Delete each selected item from a working copy list after drawing it. 查看详情 → How to Shuffle a List (Fisher-Yates Style) Swap each position with a random index in the list. 查看详情 → How to Build an Item Inventory System Add picked-up items to an inventory list and check "list contains item" at doors. 查看详情 → How to Create Weighted Probability Drops (Common / Rare) Roll 1–100 and assign ranges (1–5 Rare, 6–25 Uncommon, 26–100 Common). 查看详情 → How to Check Letter-by-Letter Typing Input Compare key press against letter (pos) of the target word and advance pos. 查看详情 → How to Find the Maximum Value in a List Initialize max to item 1 and update whenever a larger item is found. 查看详情 → How to Calculate the Average of a List of Numbers Sum every item in a loop, then divide by the length of the list. 查看详情 → How to Filter and Search a List by Keyword Use the "contains" operator to collect matching entries into a results list. 查看详情 → How to Store a 2D Tile Grid Inside a 1D List Convert (col, row) into index ((row - 1) * width) + col. 查看详情 → How to Add an Undo Button Using a History Stack Push each state onto a history list and pop the last item on Undo. 查看详情 → How to Split a Sentence into Words Read character by character and push a new word whenever a space appears. 查看详情 → How to Format Numbers with Leading Zeros (005) Join a "0" prefix whenever the number is less than 10. 查看详情 → How to Round a Number to 1 Decimal Place Multiply by 10, round to nearest integer, then divide by 10. 查看详情 → How to Sort a List from Smallest to Largest Compare adjacent pairs and swap out-of-order values (bubble sort). 查看详情 → How to Draw Any Regular Polygon with the Pen Repeat N times: move forward and turn (360 / N) degrees. 查看详情 → How to Draw a Smooth Circle with the Pen Repeat 36 times moving a small step and turning 10 degrees. 查看详情 → How to Build a Mouse Drawing / Paint App Follow the mouse pointer and toggle pen down/up based on mouse-down. 查看详情 → How to Use Pen Stamp to Bypass the 300-Clone Limit Stamp static tiles and sprites directly onto the stage layer. 查看详情 → How to Build a Working Real-Time Analog Clock Multiply current second/minute by 6° and hour by 30°. 查看详情 → How to Plot a Bar Graph from a Data List Draw vertical pen lines whose heights match each list entry. 查看详情 → How to Build a Clickable Calculator App Append clicked digits with join and evaluate when = is pressed. 查看详情 → How to Create a Study Flashcard App Toggle front/back on click and move mastered cards out of the active list. 查看详情 → How to Make a Spinning Wheel That Slows Down Naturally Multiply turn speed by 0.97 each frame until it drops below 0.2. 查看详情 → How to Build a Lucky Fortune / Random Picker App Shake the box sprite briefly, then display a random fortune costume. 查看详情 → How to Play a Mini Keyboard Piano Bind A, S, D, F keys to MIDI notes 60, 62, 64, 65. 查看详情 → How to Build a Multi-Language Translator App Combine the Translate and Text-to-Speech extensions. 查看详情 → How to Create a Webcam Motion Game Use the Video Sensing extension to detect hand movement over sprites. 查看详情 → How to Build a Study / Focus Timer (25 min + 5 min) Count down study minutes, chime, and automatically switch to break mode. 查看详情 → How to Create a Branching Choose-Your-Own-Adventure Wire choice buttons to different story-scene broadcasts. 查看详情 → How to Fix Lag and Slow Frame Rates in Scratch Remove unused forever loops, delete finished clones, and minimize color-touching checks. 查看详情 → How to Run Loops Instantly with "Run Without Screen Refresh" Enable the fast checkbox on custom blocks that draw or scan grids. 查看详情 → How to Prevent Clones from Hitting the 300-Clone Cap Use a sprite-only "isClone" variable so only the original sprite responds to spawn broadcasts. 查看详情 → How to Fix Projects That Need Two Green Flag Clicks Broadcast-and-wait an "init" message before starting any game loops. 查看详情 → How to Debug Logic Bugs by Showing Live Variables Turn on stage variable monitors to compare expected vs. actual values. 查看详情 → How to Organize Large Scripts into Clean Modules Break movement, collision, and animation into named My Blocks with comments. 查看详情 → How to Share Scratch Projects Safely Online Check for personal info and write clear instructions and credits before sharing. 查看详情 → How to Remix Another Project Respectfully Add meaningful changes and clearly credit the original creator. 查看详情 → How to Back Up Your Project as a Local .sb3 File Use File -> Save to your computer before major edits. 查看详情 → How to Add On-Screen Touch Buttons for iPad & Mobile Place left, right, and jump button sprites that set input variables while pressed. 查看详情 → How to Run Faster or Package as HTML with TurboWarp Load your .sb3 file in TurboWarp for 60 FPS testing or standalone HTML export. 查看详情 → How to Use Cloud Variables for Online High Scores Store numbers only and throttle cloud updates to at least 0.1 seconds apart. 查看详情 → How to Control a Scratch Sprite by Tilting a micro:bit Connect via Scratch Link and read tilted-left / tilted-right sensors. 查看详情 → How to Translate Your Scratch Logic into Python Map Scratch variables, repeat loops, and if blocks directly to Python syntax. 查看详情 → How to Present Your Scratch Project in Class or Contests Use a 3-part demo: 30-second live play, 1 proud script, and 1 bug you solved. 查看详情 →
本指南仅供学习参考。Scratch 界面与使用条款可能会随版本更新而变化,请同时参考 Scratch 官方网站说明。