Scratch coding example - ball game, Summaries of Computer science

Scratch coding example - ball game

Typology: Summaries

2023/2024

Uploaded on 03/29/2026

boris-karloff-1
boris-karloff-1 🇬🇧

9 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Catch the Ball
A ball falls from the sky.
When you click on it, it glides to a random
position at the top of the screen and
begins to fall again, but a little faster. If
you catch it 6 times, you win. If the egg
touches the floor, you loose.
RIGHT mouse click on the cat and select
'delete'
Click ‘Choose new sprite from file’
Click on ‘costumes’
Double click ‘Things’
Click ‘baseball1’
Click ‘ok’
Rename the sprite to ‘ball’.
Click ‘Paint new sprite’
Draw a long black line (this will be the
floor).
Click ‘ok’.
Rename the sprite to ‘floor’. Position it at
the bottom of the screen.
You also need to import TWO sprites from
the shared area (or copy them to your
home area first). They are:
Game Over.png
You Win.png
Name these sprites:
gameover
win
Click on ‘stage’
pf3

Partial preview of the text

Download Scratch coding example - ball game and more Summaries Computer science in PDF only on Docsity!

Catch the Ball

A ball falls from the sky. When you click on it, it glides to a random position at the top of the screen and begins to fall again, but a little faster. If you catch it 6 times, you win. If the egg touches the floor, you loose. RIGHT mouse click on the cat and select 'delete' Click ‘Choose new sprite from file’ Click on ‘costumes’ Double click ‘Things’ Click ‘baseball1’ Click ‘ok’ Rename the sprite to ‘ball’. Click ‘Paint new sprite’ Draw a long black line (this will be the floor). Click ‘ok’. Rename the sprite to ‘floor’. Position it at the bottom of the screen. You also need to import TWO sprites from the shared area (or copy them to your home area first). They are: Game Over.png You Win.png Name these sprites: gameover win Click on ‘stage’

Click the ‘backgrounds tab’, Click on ‘Import’ Locate a suitable background. Click ‘ok’. Click ‘Variables’ Click ‘Make a variable’ Type in ‘score’. Click ‘ok’. Click the ‘ball’ sprite. Add the blocks as shown. To create a broadcast, select the ‘new’ option at the bottom of the dropdown list on the block itself. Click the ‘Game Over’ sprite.