Scratch
Expert
60 mins
Teacher/Student led
What you need:
Chromebook/Laptop/PC or iPad/Tablet

Angles

In this fun project you create a game where you shoot a canon at an egg, but the twist is that you must bounce your shoot a certain number of times. So you need to get your angles right!

Lesson Files

Live Class Feed

This is a live feed of the latest activity by your students on this lesson. It will update in real-time as they work on the lesson.
Load previous activity

    1 - Remix our starter Scratch project

    We've created a starter project that has the sprites already added. Open this starter project by clicking on the following link and then click 'Remix' to create a copy of this project in your Scratch account (you must be signed in).

    https://scratch.mit.edu/projects/305972087/editor

    2 - Aim the canon

    Click on the canon sprite so that we can add some code to it. We're going to program the canon to point wherever our mouse is. Add the following code to the canon:

    whenclickedgotox0y0 place it in the centerforeverpointtowardsmouse-pointer rotate to follow your mouse


    3 - Program the egg

    Click on the egg sprite to give it some code. We're going to create two new messages called 'new position' and 'hit'. We'll then give the egg instructions on what to do when it receives either of these messages.

    Add the following code to the egg:

    whenIreceivenew position create this new message called 'new position'switchcostumetoegg-a normal costumegotorandom positionwhenIreceivehit create this new message called 'hit'switchcostumetoegg-b cracked costume


    4 - Program the Hit sprite

    The Hit sprite is some text that reads "Hit!!!", we're going to program this to display when you hit the egg and otherwise hide.

    Add the following code to the Hit sprite:

    whenclickedhide hide it at the startwhenIreceivesetup create this new message called 'setup'hidewhenIreceivehitstartsoundTada add this sound from the sound libraryshowwait1seconds only show for a secondbroadcastsetupbroadcastnew position


    5 - Program the Fail sprite

    The Fail sprite is some text that reads "Fail!!!", we're going to program this in a similar way to the Hit sprite.

    Add the following code to the Fail sprite:

    whenclickedhide hide it at the startwhenIreceivesetuphidewhenIreceivefailstartsoundOops add this sound from the sound libraryshowwait1seconds only show for a secondbroadcastsetup


    Unlock the Full Learning Experience

    Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our Digital Skills Curriculum.

    Copyright Notice
    This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.

    Scratch is developed by the Lifelong Kindergarten Group at the MIT Media Lab. It is available for free at https://scratch.mit.edu
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more