Page 20 - Evolve Winter 2021
P. 20

Scratch Scratch Tutorial Part 3: Space Invaders in Scratch Scratch Welcome to to the third edition edition of Merlin’s Scratch tutorial In this edition edition we will be creating space invaders in in in in scratch scratch You can create your own version or follow this this one via this this link: https://scratch mit edu/
20
1 2 First off we need to create a a new project in Scratch once this is is done go to “Choose a a backdrop” -
to add a a a a backdrop that fits the the theme After this you should also change your sprite to also fit the the theme Scratch comes with a a spaceship sprite in its library which can be used to do this click the the the icon to the the the left of the the the Once you’ve done that remove the starting sprite Now to work on on the motion of your sprite firstly make sure to center your sprite by changing its x x axis value to zero and add the following function to make it move left:
and to move right:
Now that the background and sprite have been added we can now work on implementing the logic Firstly we need to make sure the background is is always displayed by going into your sprite’s code and adding:
Next we need to animate your sprite which can be done as such:
3 Adding Alien Invaders:
For this you will have to add a a a new sprite You can choose one of Scratch’s library ones or add your own much like when we added the spaceship sprite We must then work on on the the positioning and animation of the sprite by adding the following to it:
After the positioning and animation has been completed we can now work on the the the movement of the the the aliens to to allow them to to change direction each each time it reaches the the edge of the the backdrop 

























































































   18   19   20   21   22