Basketball Game

3
Unit 2 Control Technology Creating a game using Scratch Play Scratch ‘Basketball Shoot’ Aim: Score as many points as you can with five shots taken from any one of the five positions marked. As with all scratch activities you need to create instructions that will animate a number of sprites. These appear complex, but a pattern emerges and certain instructions are used constantly in this game. What level will you be working at? Level 4: If you have an incomplete game and have just copied the instructions used. Level 5: If you have got a working game and made some changes to the instructions. Level 6: If you have made clear changes to the instructions and described how it improves the game. Level 7: If you have created a new game that is fully functional and incorporates a range of technique. Creating and Playing the game 1. Setting up the game: When playing switch to Presentation mode by clicking in the right hand of the icons in e page The Background tab is selected and the chosen background is imported Click to resize sprites larger or smaller The boy walking is selected from the People folder. The girl1 standing sprite is also selected from the People folder, resized smaller and placed in the background. This sprite plays a minor role later! The basketball sprite is taken from the Things folder. To create a variable click on the Variables button and then Make a variable. Give it a title here There are 3 variables to create: 1. Count the number of shots left 2. Give the score for the shot 3. Give the current total score

description

Worksheet to help you make a basketball game using Scratch

Transcript of Basketball Game

Page 1: Basketball Game

Unit 2 Control Technology Creating a game using Scratch

Play Scratch ‘Basketball Shoot’

Aim:

Score as many points as you can with five shots taken from any one of the five positions marked.

As with all scratch activities you need to create instructions that will animate a number of sprites. These appear complex, but a pattern emerges and certain instructions are used constantly in this game. What level will you be working at? Level 4: If you have an incomplete game and have just copied the instructions used.

Level 5: If you have got a working game and made some changes to the instructions.

Level 6: If you have made clear changes to the instructions and described how it improves the game.

Level 7: If you have created a new game that is fully functional and incorporates a range of technique.

Creating and Playing the game

1. Setting up the game:

When playing switch to Presentation mode by clicking in the right hand of the icons in

e page the top right of th

The Background tab is selected and the chosen background is imported

Click to resize sprites larger or smaller

The boy walking is selected from the People folder. The girl1 standing sprite is also selected from the People folder, resized smaller and placed in the background. This sprite plays a minor role later! The basketball sprite is taken from the Things folder.

To create a variable click on the Variables button and then Make a variable. Give it a title here

There are 3 variables to create: 1. Count the number of shots left 2. Give the score for the shot 3. Give the current total score

Page 2: Basketball Game

Unit 2 Control Technology Creating a game using Scratch 2. Clicking the green flag begins the game by resetting the previous scores and then further instructions are used to get a sprite to walk on screen (boy4-walking). All five costumes are used. These instructions are

repeated five times for each costume beginning with boy4-walking-e. The timings used try to get a realistic looking walk!?

The say instruction allows the simple rules to be introduced!

Resets previous scores

Starts the game

The whole block can be duplicated by right clicking on the top instruction and clicking on duplicate or use the repeat instruction! This gives a longer walking action.

This instruction ensures the ‘boy’ sprite always comes from the left side of the stage.

2. The game requires the player to click on the desired shooting position. Each of the five spots are sprites and created in Paint.

Number is dragged into the spot.

Paint new sprite option is selected

Number colour selected

Use the Ellipse tool Each spot is then positioned on the background.

Any timing or number in an instruction block can be easily altered by clicking in the window.

Page 3: Basketball Game

Unit 2 Control Technology Creating a game using Scratch 3. The player must now click on a numbered spot at random. To get the boy sprite to go to each

position you have to link both sprites. Each of the numbered sprites is given the following instruction when clicked on. The number in the broadcast box relates to the number in the sprite. The boy sprite has same instruction for all the numbered sprites.

This instruction tells the boy to glide to particular coordinates over the numbered spot

Coordinates are used when you want to position sprites accurately. The current coordinates of the sprite are always displayed at the top of the script (centre section).

Move the sprite where you want it to go and then record the coordinates into the instruction being used.

4. It is now time to create the shooting instructions for each of the five positions. These can be altered to change the game. The following give a range of points depending on the quality of the shot. When the girl is hit on the head this gives a negative score!

The following instructions are part of the script for the basketball sprite. The set of instructions for each of the shooting positions are set up in a similar way using the same instructions. They appear complex but are in fact easy to set up once you get the ‘hang’ of it! The number pressed on the keyboard (same as the shooting number) sets the path of the ball. Keyboard number 2

The path of the ball is created by fixing a number of coordinates and using the glide instruction.

The change size instruction makes the ball smaller as it travels further away.

The play sound instruction is used after the girl is hit on the head. A yah sound follows each successful shot!

When the ball is clicked on: 1. It is made bigger because on all shots the ball gets smaller as it travels away! 2. This instruction means the ball will always go to sprite1 (boy walking). 3. This instruction means the ball will be in front rather than hidden! The scores on the variables are changed by these

instructions. The points awarded can be changed. It is up to the player to learn from each shot as to how to get the best score from five shots.

Can you create this game or improve on it or do something different!