16 September 2016
Whenever we're on holiday, if there's a maize maze or a hedge maze nearby, we always take a look. Mazes fascinate me.
So when it came to planning projects for Cool Scratch Projects in Easy Steps, I thought it would be interesting to include some maze games. In my previous book Scratch Programming in Easy Steps, there's a chapter of seven short projects at the end and one of those was a really simple script to enable you to move a dot through a maze without being able to walk through walls. Although it's a short project, it was really popular, so I know many readers share my interest in mazes.
As a result, there are three maze projects in Cool Scratch Projects in Easy Steps. The first is Maze Maker, which will generate a random maze for you based on a grid you provide it. You can save an image of the Stage, and reload it as a sprite or background, so you can use the mazes generated by this project in pretty much any game. This project was an opportunity to show how you can make more complex programs, and it uses a technique I previously used for my Minecraft Maze Maker, which appeared in Raspberry Pi For Dummies and Raspberry Pi Projects. Here's a video of it in action, drawing a brain shaped maze:
Then, there's a game called Circuit Breaker, which uses mazes generated in Maze Maker. In this game, you have to track down as many bugs in the circuit as you can in two minutes. The time pressure makes it quite a tense game, because you often have to move on instinct rather than trying to trace the entire route before moving. As with all the projects in the book, I've included suggestions for how you can expand on them and one of my favourite ideas for customising this game is to award bonus time when you catch a bug. I'm sure you can think of other things you can do with this project. Here's a video of it in action:
The third maze project is a 3D Maze Explorer, which enables you to walk through a maze. You move by turning left or right and then walking forwards or backwards. The arrow in the top left is a compass that points north. The maze can be randomly generated, using the Scratch Maze Maker project, or you can design it yourself. The book shows you how to get the script working with both types of maze. It also shows you how to add collectables (cakes, in fact!) to your hand-designed mazes, and you can adapt the script to add them to random mazes too. Here's a video that shows me playing the game. At times it might be a little bit confusing because you can't see which keys I pressed and I've gone through it quite fast, but the game feels natural when you're playing it. It starts by scanning in one of the random mazes.
Cool Scratch Projects in Easy Steps is hot off the presses and in the shops now! My previous book Scratch Programming in Easy Steps is also available, and the two complement each other nicely, with "Cool" showing you how to build specific cool projects, and "Programming" going into greater depth on how the Scratch programming language works.