Animate a ghost Part-1

 Animate a ghost

Creating a new Scratch project

You can use Scratch online or offline.

  • Online - to create a new Scratch project using the online editor, go to rpf.io/scratch-new

  • Offline - if you prefer to work offline and have not installed the editor yet, you can download it from rpf.io/scratch-off

The Scratch editor looks like this:

screenshot

  • The cat sprite that you can see is the Scratch mascot. If you need an empty Scratch project, you can delete the cat by right-clicking it and then clicking delete.

screenshot

  • Click Choose a sprite to see the library of all Scratch sprites.

    screenshot

  • You can search or browse sprites by theme. Click on a sprite to add it to your project.

    screenshot

  • Click on Choose a Backdrop in the bottom right.

screenshot

  • You can search for a backdrop or browse for one by category or theme. Click on a backdrop to select it.

screenshot


Add code to your ghost sprite so that the ghost appears and disappears forever when the green flag is clicked.

Now organize!!




PART 2 

Order the Element 
Add the Following Blocks to your Code 

Code for catching ghosts

Now you’re going to add code to your game so that the player can catch ghosts!

Can you make your ghost disappear when it’s been caught? The player should be able to click ghosts to catch them.

Now Add this Blocks to your code and put it in the correct order


Add a score

Now you’re going to make your game more interesting by keeping score!
  • Click on Variables in the Code tab, then click on Make a Variable.

    Variable blocks

  • Type in the name of your variable. You can choose whether you would like your variable to be available to all sprites, or to only this sprite. Press OK.

    Create variable

  • Once you have created the variable, it will be displayed on the Stage, or you can untick the variable in the Scripts tab to hide it.

    Variable on the stage



Can you keep track of the player’s score? Players should score points when they click on ghosts to catch them.

Each time a player clicks on a ghost, their score should increase.

Increasing score


When the green flag is clicked, your score variable should be set to 0. The Stage is the best place to add this code.

When the ghost sprite is clicked, the score variable should be changed by 1.


Order 
Save the Game

Part 3