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!

Teacher Class Feed

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:

    when green flag clicked go to x (0) y (0) // place it in the center forever point towards (mouse-pointer v) // rotate to follow your mouse end


    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:

    when I receive [new position v] // create this new message called 'new position' switch costume to (egg-a v) // normal costume go to (random position v) when I receive [hit v] // create this new message called 'hit' switch costume to (egg-b v) // 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:

    when green flag clicked hide // hide it at the start when I receive [setup v] // create this new message called 'setup' hide when I receive [hit v] start sound (Tada v) // add this sound from the sound library show wait (1) seconds // only show for a second broadcast (setup v) broadcast (new position v)


    123learn · Online learning platform

    Unlock the full learning experience

    You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.

    Hundreds of curriculum-aligned lessons
    Interactive activities in every lesson
    Printable resources & progress tracking
    Copyright Notice
    This lesson is copyright of Coding Ireland 2017 - 2026. 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