Scratch Maze Game

Dropper helper imageStep 4 – Deal with hitting the walls

Setting the collision up:

If the sprite hits the wall something bad needs to happen.

The walls are all black, so we can use this as a way of dealing with the sprite hitting them.

  1. You need to add this code inside the Forever block
  2. Use an orange IF – THEN block
  3. Add a light blue touching colour block inside the IF – THEN block

    Now the tricky bit

  4. Click on the colour inside the touching colour block
  5. This pops out a new window. At the bottom, click on the eye dropper – this lets you click on a colour on the backdrop and select it
  6. Move your mouse over one of the maze walls until it selects black and click – the colour in the block should turn to black

Take care with the eye dropper tool to pick the right colour.

Code helper imageDealing with the collision:

Now you need to add code inside the IF – THEN block to say what happens when there is a collision.

You can chose what to do. There are lots of different options and you could combine these or come up with your own ideas.

Or you could do something else. What would make the best game?