34
Learning Outcomes • To create a game using scratch software. • To use scripts. • To understand basic concept in programming.

Makingagame in scratch

Embed Size (px)

DESCRIPTION

Showing how to make a game in scratch. All instructions all the user to create a game of pacman

Citation preview

Page 1: Makingagame in scratch

Learning Outcomes

• To create a game using scratch software.

• To use scripts.

• To understand basic concept in programming.

Page 2: Makingagame in scratch

Keywords

• Iteration – forever loop

• Selection – forever if

• Variables

Page 3: Makingagame in scratch

Following instructions

• Backward 2

• Forward 2

• Turn 180

• Hands up

• Hands down

Page 4: Makingagame in scratch

Following instructions

Forever

Backward 2

Forward 2

Turn 180

Hands up

Hands down

Page 5: Makingagame in scratch

Following instructions

Forever if (my hand up)

Backward 2

Forward 2

Turn 180

Hands up

Hands down

Page 6: Makingagame in scratch

Where to open the task

• P:\ICT folder\Year 7 ICT\Topic 6 Game on\Lesson 4

• Makingagame.ppt

Page 7: Makingagame in scratch

Plenary

•P:\ICT folder\Year 7 ICT\Topic 6 Game on\Lesson 4

•Complete the plenary.doc

Page 8: Makingagame in scratch

Step 1

1.Delete the cat sprite. Right click on the sprite and select delete.

Page 9: Makingagame in scratch

Step 2 - Changing backgrounds

1. Click on the stage

2.Select backgroundClick on Edit

Page 10: Makingagame in scratch

Step 3 -Adding background colour

Use the fill tool to create the background

Page 11: Makingagame in scratch

Step 4 - Adding a grid

Use the rectangle tool to create the grid

Page 12: Makingagame in scratch

Step 5 - Create a pacman sprite1. Select the paint new sprite button

2. Create your pacman2

1

Page 13: Makingagame in scratch

Step 6 – adding the dot

Use the paint brush to draw a dot in front of pacman. This should be different colour to the Pacman

Save your pacman by clicking OK

3

Page 14: Makingagame in scratch

Step 7 - Create a new costume

2.Click on copy to create a new costumeClick on Edit for Costume2

3. Use the erase tool to create a mouthClick OK

1

2

1. Select the costume tab

Page 15: Makingagame in scratch

Step 9 – creating a new sprite

Click on create new sprite

1

Page 16: Makingagame in scratch

Step 10 - Create a target sprite

Draw a circle the same colour as your background.

Draw another circle in the same coloured dot. (i.e orange)

Page 17: Makingagame in scratch

Step 11 - Shrink your spritesClick on the icon to shrink your sprite

Page 18: Makingagame in scratch

Step 12 - Duplicating your sprites

Page 19: Makingagame in scratch

Step 13 - Script blocks

Create a script for the sprite to change costume.

Hint Use the colour coding to help you

Page 20: Makingagame in scratch

Step 14 - Scripts to control movement of your pacman

Create a new script.This will move the pacman

This is the colour of the dot

This is the colour of your background

Page 21: Makingagame in scratch

Step 15 - Script to control direction

Create scripts to move the sprite right, left, up and down.

Page 22: Makingagame in scratch

Step 16 - Make a variable

Click on the stage

Click on variables

Give variable name orangecount

Page 23: Makingagame in scratch

Step 17 - Set the starting value

Add this script to the stage

Page 24: Makingagame in scratch

Step 18 - Change the variable

1.Click on Sprite2

Add the code to sprite 2

Page 25: Makingagame in scratch

Step 19 - Duplicate script and add to other sprites

Right click and click duplicate

Drag the duplicate to the other sprites

Page 26: Makingagame in scratch

Step 20 - Stopping the game

Click on the stage

Create this script

Change this to match the number of oranges

Page 27: Makingagame in scratch

Step 21 - Game TimerCreate a new variable called timer

Create this script to set the timer to go up by one second each time

Page 28: Makingagame in scratch

Challenges

• Can you write short scripts to do the following:-• 1. Reset the time to zero at the start of the

game?• 2. Replace the Pacman in the top left hand

corner at the start of the game?• 3. reposition Pacman to face twoards the

righthand side of the screen. • (hint if you click on the sprite you can see the

coordinates and position.

Page 29: Makingagame in scratch

Include a bonus feature

Choose new sprite from file

Select from the folder

Place the bonus symbol on the board

Page 30: Makingagame in scratch

• Create a new variable called speed• In the stage scripts area, set the

starting value to 2• Adjust the pacman sprite script to• Click on bonus spite. Duplicate the

script from other sprites.• Change the script to double the speed.

(hint set the speed variable to 4)

Page 31: Makingagame in scratch

Changing the bonus sprite

Add this script to the bonus sprite.

Remember to change the orange count to 5

Page 32: Makingagame in scratch

Create a ‘Game Over’ screen

Create a new background by clicking on copy

Click on Edit on background 2

Add the text Game Over

Page 33: Makingagame in scratch

Game over script

Add the final script to the stage to finish the game

Page 34: Makingagame in scratch

plenary

• Write down what you have done today on your game.

• Write down what scripts you have used an try to explain how one of them works.