Parrot Shooting Game

  1. Creating the Parrot Sprite
  • Delete the default sprite (cat figure) (Right-Click  Delete)
  • Import the Parrot sprite (Choose new Sprite from file)           
  • Decrease the size of the Parrot 
  • Click on Shrink Sprite
  • Click on the Parrot until correct size

2.  Getting the Parrot to move across the screen forever

  • Go to the Scripts section of the Parrot Sprite
  • Add the Script: when  clicked:
  • Parrot to move forward 10 steps forever

The parrot will now move to the right until it touches the edge of your screen

3.  Getting the Parrot to bounce back when touching the edge of the screen

1.  Add the if on edge, bounce motion script

The parrot now flies in circles, how can we make the parrot move randomly around the screen:

  • In number of steps it moves forward
  • Different angles when touching the edge of the screen
  • Use the Random Scripts to solve this task
  • Use the Wait Script to slow down the parrot’s movement The parrot now flies randomly across your screen

4.  Creating multiple parrots

  1. Click on the Costumes tab of the Parrot sprite
  2. Right-click the Parrot image and select                                    
    • Turn into new Sprite
  • Resize the new sprite
  • Drag and drop the Script from the first Parrot sprite onto Sprite 2
  • Click :

You should have now 2 parrots moving around the screen randomly

  • Create 3 more Parrot Sprites
  • To make the 5 parrots move randomly you can change the Move and Turn variables for each Sprite

5.  Changing the background

  1. Click on Stage
  • Click on the Backgrounds tab
  • Click on Import and select a background image and click OK
  • Delete the blank background

Job done!!

Alternatively you can create a background from scratch by clicking on Paint

6.  Creating the Crosshair

You can create your own crosshair or use a crosshair image; we are going to create one ourselves

  1. Click on Paint new Sprite
  • Draw your Crosshair
  • Click OK
  • Increase or decrease the size of your crosshair

7.  Hide and show your parrots

We are going to use the spacebar to shoot a parrot.

We need to programme that:

  • When the Spacebar is pressed
  • AND the crosshair Sprite is touching a Parrot Sprite
  • Hide the parrot

Here is one way of doing this:

  • Click on a Parrot Sprite
  • Click on the Script Tab
  • Programme the above sequence of actions

8.  Moving your Crosshair

We want the Crosshair to be moved around by the Mouse pointer, how can we enable this?

  1. Click on the Crosshair sprite
  • Click on the Scripts tab
  • Programme that the Crosshair will follow the Mouse pointer

You will notice that the Crosshair will go to the spot the Mousepointer was and that is it. How can we make sure the Crosshair will keep going were the Mouse Pointer is???

How about Forever? Lets try this:

TEST: Move your mousepointer over the moving Parrots and click the Spacebar (Shoot): Does the parrot hide?

Reset the game to the start screen

Ok you shot down all the Parrots, but how do you get them all back and replay the game? Well you need the Show feature.

Programme that when you click all parrots are visible again

  1. Click on Sprite1 and Click on the Scripts tab
  2. Add the programming code
  3. When A is pressed
  4. Show parrot (Sprite)
  5. Drag and drop this code to all other Parrot Sprites

Extension tasks:

  1. We want to hear a sound when hitting the space bar
  2. We want to hear a background sound continuously while paying the game

10.  Keeping the score

Wouldn’t it be great if we could keep the score when shooting down the Parrots? But there is more I want to do with the score:

  • I want to have a score box in the background of my game
  • Every time I shoot down a Parrot; add 10 point to my total score
  • Every time I press down the Spacebar I want to remove 1 point from my total score
  • Reset the score when I restart the game

Here is one way of doing this:

  • Click on Variables      
  •    Click on make a variable
  • Type in Score and Click OK

You now see that you have a scoreboard in your background and a set of score variables.

Ok, we want now; when we hit the Parrot, to add 10 point to the total score, mmmmmm, let me think where I could add this programming code…….

Remember the code:

I can do something with that.

I can add the 10 points code in there.

Add the change Score by 10 variable (see below)

NOTE: Make sure all Parrot Sprites have this code (Drag and Drop the code)

Test your parrot game and check if your score is going up when you shoot down a parrot.

11.  Remove 1 point when pressing the Space bar

Simply add change score by -1 ABOVE the IF statement

NOTE: Make sure all Parrot Sprites have this code (Drag and Drop the code)

TEST: Test if it all works or do I need to make a change???

12.  Reset the score at the start of the game

When you restart the game (unhide the parrots) you want the score to be reset to 0 Add the code to the Unhide Parrot script.

13.  Setting a timer

Wouldn’t it be great if we could set a timer? You need to shoot all parrots before the timer reaches 0 otherwise the game will STOP.

Here is one way of doing this:

  1. Click on Variables         
  •      Click on make a variable
  • Type in Clock and Click OK

You now see that you have a Clock in your background and a set of Clock variables. What code to use?

The code must do the following:

  • When the game starts
  • The clock must be set to 30 seconds
  • Then wait a second
  • And change the clock by -1
  • This should al be repeated 30 times
  • When clock reaches 0 everything should be stopped

Extension tasks:

  1. I want to see a “Game Over” message when the clock reaches 0 before I have shot down all parrots
  2. I want to see a “You are a Winner” message when I have shot down all parrots before the time ends

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.