🍎How to make a "Apple and Basket" game
🧰 What You’ll Need:
-
A Scratch account: https://scratch.mit.edu
-
Internet access
-
No coding experience required!
🔨 Step 1: Create a New Project
-
Go to scratch.mit.edu and log in.
-
Click "Create" to start a new project.
-
Delete the default cat sprite by right-clicking it and choosing delete.
🍎 Step 2: Add Sprites
-
Click the “Choose a Sprite” button.
-
Search for and add:
-
A basket sprite (or choose something like "bowl").
-
An apple sprite.
-
🎨 Step 3: Set the Stage
-
Click on “Choose a Backdrop” and select a background (like "Blue Sky").
-
Optionally, you can draw your own!
🧠 Step 4: Code the Basket (Player)
Make it move left and right:
-
Click the basket sprite.
-
Add this code:
🍏 Step 5: Code the Apple (Falling Object)
-
Click the apple sprite.
-
Add this code:
❤️ Step 6: Add a Lives Variable
-
Click "Variables" → "Make a Variable" → name it Lives.
-
Set it to 3 at the start:
-
Add a "Game Over" message:
⭐ Step 7: Add Score (Optional)
-
Make another variable called Score.
-
Inside the apple's code, when it touches the basket:
✅ You’re Done!
Now click the green flag and play your game:
-
Move the basket with arrow keys.
-
Catch the falling apples.
-
Miss three apples, and it’s game over.
Comments
Post a Comment