A Scratch tutorial. Description: You have 6 bullets to shoot at 2 targets. Every time you hit any of...
-
Upload
emery-wilkerson -
Category
Documents
-
view
212 -
download
0
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.](https://reader035.fdocuments.us/reader035/viewer/2022072010/56649dd05503460f94ac4fee/html5/thumbnails/1.jpg)
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.](https://reader035.fdocuments.us/reader035/viewer/2022072010/56649dd05503460f94ac4fee/html5/thumbnails/2.jpg)
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.](https://reader035.fdocuments.us/reader035/viewer/2022072010/56649dd05503460f94ac4fee/html5/thumbnails/3.jpg)
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.](https://reader035.fdocuments.us/reader035/viewer/2022072010/56649dd05503460f94ac4fee/html5/thumbnails/4.jpg)
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.](https://reader035.fdocuments.us/reader035/viewer/2022072010/56649dd05503460f94ac4fee/html5/thumbnails/5.jpg)
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.](https://reader035.fdocuments.us/reader035/viewer/2022072010/56649dd05503460f94ac4fee/html5/thumbnails/6.jpg)
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.](https://reader035.fdocuments.us/reader035/viewer/2022072010/56649dd05503460f94ac4fee/html5/thumbnails/7.jpg)
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.](https://reader035.fdocuments.us/reader035/viewer/2022072010/56649dd05503460f94ac4fee/html5/thumbnails/8.jpg)
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.](https://reader035.fdocuments.us/reader035/viewer/2022072010/56649dd05503460f94ac4fee/html5/thumbnails/9.jpg)
![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.](https://reader035.fdocuments.us/reader035/viewer/2022072010/56649dd05503460f94ac4fee/html5/thumbnails/10.jpg)
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?