LS1 COMPUTING
10/09/2024
HELPFUL STEPS FOR SIMPLE SCRATCH GAMES
1. Motion Blocks :
- Move (10) steps : Moves the sprite by a set number of steps.
- Turn clockwise/anti-clockwise : Rotates the sprite in the specified direction.
- Go to (x, y): Moves the sprite to specific coordinates.
- Glide to (x, y) : Makes the sprite smoothly glide to a specific position.
- Point in direction : Changes the sprite's direction.
2. Control Blocks :
- When (green flag) clicked : Starts the game when the green flag is clicked.
- Forever : Runs the enclosed code block continuously.
- If ___ then : Runs code if a certain condition is true.
- Wait ___ seconds : Pauses the code for a set number of seconds.
- Repeat (10) : Repeats the enclosed blocks for a set number of times.
- Broadcast (message) : Sends a message to trigger other scripts.
3. Sensing Blocks :
- Touching (mouse-pointer/edge/other sprite)? : Detects when a sprite touches another object.
- Key (space) pressed? : Detects if a certain key is pressed.
- Mouse down? : Detects if the mouse is clicked.
4. Looks Blocks :
- Switch costume to (costume) : Changes the appearance of the sprite.
- Say (Hello!) for (2) seconds : Displays a speech bubble for a certain time.
- Show/Hide : Makes the sprite visible or invisible.
5. Sound Blocks :
- Play sound (pop) : Plays a sound.
- Stop all sounds : Stops any playing sounds.
6. Events Blocks :
- When (space) key pressed : Starts an action when a key is pressed.
- When backdrop switches to (backdrop) : Starts an action when the backdrop changes.
7. Variables and Operators :
- Set (variable) to (0) : Initializes or changes the value of a variable.
- Change (variable) by (1) : Increases or decreases the variable by a set amount.
- Operators (e.g., <, =, and +) : Used for conditions and math operations.
Example: Simple Maze Game
- Use Motion blocks for controlling the sprite's movement with the arrow keys.
- Use Control blocks to detect if the sprite touches the walls or reaches the goal.
- Use Variables to keep track of the player's score or level.