Scratch
50 mins
+140 XP
What you need:
Chromebook/Laptop/PC or iPad/Tablet

Sound effects

Sound effects are a great way to improve a game or story. In this baseball game we'll add in sound effects for hitting the ball and the crowd.

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 - Create a new Scratch project

    Create a new Scratch project and delete the cat sprite.

    2 - Add the Baseball 2 backdrop

    Ass the Baseball 2 backdrop from the backdrop library.


    3 - Add and code the Batter sprite

    Add the Batter sprite from the sprite library and then add the following code to make her swing bat when you press the space bar.

    whenclickedgotox169y37switchcostumetobatter-a start with this costumewhenspacekeypressedswitchcostumetobatter-bwait.1secondsswitchcostumetobatter-cwait.1secondsswitchcostumetobatter-dwait.1seconds



    4 - Add and code the Baseball sprite

    Add the Baseball sprite from the sprite library and give it the following code to set it up for the start and make it move towards the batter.

    whenclickedshowsetsizeto25%gotox-210y45 the middle of the left hand sideforeverchangexby10 make it move to the right



    5 - Detect a hit

    When the ball touches the bat we will play a hit sound. To detect if the ball touches the bat we will use a touching color   ? block and use the colour of the bat.

    Add the following code to the Baseball sprite, underneath the change x by 10  block. 

    whenclickedshowsetsizeto25%gotox-210y45foreverchangexby10 add new code under hereiftouchingcolor?then


    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