We are using Scratch. CLICK HERE TO OPEN SCRATCH
My friends have a 6 year old son that had to cancel his birthday so he was really sad. I made this game for him as a birthday present.
We are going to build our own Item Collection Game.
Add 5 Sprites-
- A playable Character
- A collection item
- An enemy
- This Health bar(right click and save to computer)
- Text that says a Game Over
You can add Sprites by hovering over the cat head and choosing one of the options.
Choose one in scratch for now. Click the Cat Head or Magnifying Glass. The only one you should Upload is the Health Bar. To make Game Over, click the Paintbrush and use the Costumes Tab to type the letters.
Position your Sprites on the Screen. Make them fit better in the game by decreasing their size. Edit the number in Size. Again, you can draw your own characters later.
Move the Health Bar to the Top Right and the Game Over to the Top Middle.
We will create the code that makes the player move around.
You drag script into the space. Pay EXACT attention to what the blocks say. Some of them require you to type in numbers or choose options.
Code is divided into colored section. Click the right color to find the script block in that list. Drag it out exactly how I have it.
The second list of scripts require that you put blocks inside each other. Make sure you have the exact same options that I do.
Connect the bigger sections together, stick them all in the Forever, then connect forever to the block above.
If you followed the directions correctly, hit the Green Flag. The arrow buttons let you move the character around.
The next script makes the character animate by rotating thru its costumes. The Cat has two costumes.
Now we will make a variable. A variable stores information. You will find the orange circle then click the Make a Variable button. Type the word “Health” check the box “For All Sprites” then hit Ok.
The last script of your character will reduce your health if you hit the Enemy Sprite. You may want to rename your Sprites if that helps keeping track of their names.
Now we are creating the scripts for your collectible item.
First, click the Collectible to start editing it. Then make a variable called Score.
Then build these scripts. The top script hides the original collectible. The middle script tells the clones (or copies) to show up in random spots. The bottom script tells the game that when you as a player touch the collectible, it increases the score by one and deletes the clone.
The clones won’t spawn just yet. To do that, we need to edit the Stage.
This is a pretty simple script. This tells it every 3 seconds to create a clone of the collectible. Make sure you select the right name of the clone.
The enemy is the most complicated scripting. Please pay attention to what each block says.
Click the enemy.
First make two new variables- “Speed” and “last spot”
Make sure to uncheck variable boxes so only Score shows in the Play area.
I don’t expect you to fully understand how they work but these are the scripts you need to make:
- Sets the Speed and animation of the enemy
- Slowly increases speed of enemy
- If your health hits 0, the game stops.
- This makes the enemy point in the right direction
- This makes the enemy move around
This script is long but pretty simple. Each costume of the Health bar is a different number of Health. 6 Health is 3 full hearts. 5 Health is 2 and a half hearts and so on. The other script makes sure your Health starts at 6 on every new game.
This step is also easy. Select Game Over and then make this script.
Basically it is hidden as long as Health is not zero.
It’s more fun if these Sprites were designs that you made!
Use Piskelapp.com to design your own sprites.