Mar 092017
- Log into Scratch and start a new project
- Set up gravity: use forever, change y by…
- Play to check that the cat falls
- But gravity only moves you if you are in the air,…
- Draw the ground on your background
- You only want the cat to fall if is not touching the ground
- Use: if, not, touching colour… inside the forever loop
- Play to test it out and drop the cat in different places to check that it works.
- ** What happens if you put the cat under the ground?! Why?
- Now add some floating levels of the same colour and test again
- Add keyboard controls:
- Left/right: use when left key pressed; change x by
- Jump: use when space key pressed; change y by…
- Test your game
- What works well?
- Even better if…
- Can you think of solutions to you even better ifs?
Next level
- Where do you want your sprite to start? Use the go to x _ y _ block when the green flag is pressed to start at the right place.
- Add an end place in a different colour to the platforms.
- Draw a new background.
- Use: forever, if, touching colour, next background
- Test your game.
Collect shapes
- Make a new sprite for the character to collect, eg star, banana…
- Place it where you want it to be.
- Only do one – when you have programmed it, you can duplicate more
- Use: when green flag pressed, show, forever, if, touching sprite, hide
- ** Create a variable called score
- set it to 0 at the beginning of the game
- make it add 1 every time you collect an item
Baddies
- Create a sprite for the character to avoid
- What will happen when you touch it? (Hide sprite and change background to “Game over”…)