A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of...

10
Shooting Arcade A Scratch tutorial

Transcript of A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of...

Page 1: A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of them you get two extra bullets but the targets get.

Shooting ArcadeA Scratch tutorial

Page 2: A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of them you get two extra bullets but the targets get.

Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of them you get two extra bullets but the targets get 10% smaller every

time you hit them.Once both of them become less than 10% of their

original size – you win, otherwise – game over!

Page 3: A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of them you get two extra bullets but the targets get.

Variables

• Bullets – start with 6• Score – starts with 0

Page 4: A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of them you get two extra bullets but the targets get.

Sprites

• Aim• Flash• Target1• Target2• gameover

Page 5: A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of them you get two extra bullets but the targets get.

Aim is controlled by the mouse

The “forever” block controls the rest of the program

Aim follows the mouse

When the mouse button is pressed a signal is sent to Targets, if they are touching Aim they are “shot”

When all bullets are gone – Game over!

When both targets become tiny – you win!

Page 6: A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of them you get two extra bullets but the targets get.

Target1 runs around and gets shot at

Try different initial sizes to make the game interesting

That starts the game and initialises all settings

Randomly glides around the screen

If less than 10% in size – goes to lower corner, out of the way and stops its movement by halting its script

When receive a signal that a shot has been fired, checks if was touching the Aim in the moment of the shot.

Page 7: A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of them you get two extra bullets but the targets get.

Flash follows the Aim and appears only for short moments of the shots fired.

• Two blocks in the Flash area• The first one initialises the size to 100% and

makes the flash normally invisible• It also turns on the “forever” block to follow

wherever the Aim is• The second one makesthe Flash appear andShrink 10 time.

Page 8: A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of them you get two extra bullets but the targets get.

Gameover message

• Invisible at the start of the game• (Ghost=100% is invisible)• Then made visible at the end.• (Ghost=0% is visible)

Page 9: A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of them you get two extra bullets but the targets get.
Page 10: A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of them you get two extra bullets but the targets get.

Extension activities:

• Put more targets• Put Trees and other objects behind which the

Targets can hide (how can you program that?)• Also, you will notice that it is very easy to lose

all bullets in one go, can we fix that?