24
Marble Racer

Marble Racer

  • Upload
    akiko

  • View
    53

  • Download
    0

Embed Size (px)

DESCRIPTION

Marble Racer. The screen where you can see what happens when you play your game is called the STAGE . The SCRIPT BANK is where the types of instructions are stored. The SCRIPT BLOCKS are where the instructions of what your SPRITES can do !. - PowerPoint PPT Presentation

Citation preview

Page 1: Marble Racer

Marble Racer

Page 2: Marble Racer

The screen where you can see what happens when

you play your game is called the STAGE.

The SCRIPT BANK is where the types of instructions

are stored.

The SPRITES are where you store and select the STAGE and

COSTUMES

SCRIPTS AREA is where you put your instructions

The SCRIPT BLOCKS are where the

instructions of what your

SPRITES can do!

Page 3: Marble Racer

What is a Sprite?

A Sprite is a character that plays in the game

Students can change their sprite, either by drawing a new one

Or choosing one from a file

Page 4: Marble Racer

Lesson 2 – Marble Racer

Page 5: Marble Racer

Design a racetrack and car

You need to design a simple racetrack and race car as viewed from above.

You will need to keep your design simple so that you can draw it using the paint editor

You will need to use clear colours as these will be used to detect the position of the car.

Page 6: Marble Racer

What will we learn?

Move a sprite using the keyboard. Add to players to the game Use the stop script to stop a game Use the say block to announce a winner Add a timer to show the winning time

Page 7: Marble Racer

Create a new background with the editor

Click on the stage and use the editor to draw a racetrack

Page 8: Marble Racer

Add a car sprite that you have designed

Page 9: Marble Racer

Use the up arrow key to move the car

Use the forever control block and the if control with the key pressed sensor to detect a key pressed and move the car.

Page 10: Marble Racer

Use the up arrow key to move the car

Use the forever control block and the if control with the key pressed sensor to detect a key pressed and move the car.

Page 11: Marble Racer

Use the other arrow keys to move the car

Test the program to make sure you can move the car in all directions. Change the move steps amount to slow down or speed up the car.

Page 12: Marble Racer

Use the other arrow keys to move the car

Test the program to make sure you can move the car in all directions. Change the move steps amount to slow down or speed up the car.

Page 13: Marble Racer

Add a second car

Use the a, s, w, z, keys to control the second car so you can have a two player game

Page 14: Marble Racer

Test your game

Get into pairs and play each others games to make sure that both cars move correctly in all directions.

Page 15: Marble Racer

Be a winner!

Create a finish line sprite so that when a car touches the finish line they win!

Page 16: Marble Racer

Key Point – Stop Script

Stop script Use the stop script so that once a car has won the race

another car cannot win. Try the game without the stop script.

Page 17: Marble Racer

What else do we need?

Add a timer to see how fast the winning car goes. Stop the game if a car goes on the grass OR keep a

score of the number of times the car goes on the grass Reset the game once a car has won

Page 18: Marble Racer

Add a timer

Tick the timer on the sensing block to create a timer

Page 19: Marble Racer

Add a timer

Tick the timer on the sensing block to create a timer

Page 20: Marble Racer

Announce the winning time

Use the say block from the Looks controls and the reset timer from the sensing controls to announce the winning time

Page 21: Marble Racer

Announce the winning time

Use the say block from the Looks controls and the reset timer from the sensing controls to announce the winning time

Page 22: Marble Racer

Stop the car if it goes on the grass

Use the if control with the touching colour sensor to detect the car on the grass. Reset the car position when green flag clicked.

Page 23: Marble Racer

What now? Get into pairs and play your games and see what

improvements you can make. Discuss your games with each other as you test them. You made to need alter the size and orientation of the

cars to get them both to fit on the start line. You may want to change the value of move to slow the

game down if you are crashing all the time.

Page 24: Marble Racer

Extension tasks

Create a timer for each car using variables Make the car explode when it goes on the grass (hint:

switch costumes) How can you stop a car going backward around the

course and crossing the finish line in the wrong direction?

Change the stage at the end of the race to show a new racetrack and start a new game