See Jan's super cool Cop and Robbers Game below - or should I say Zombies and Scientist!
This week in Game Dev Club, our Modders have been coding a brand new game: Cops and Robbers. In this top-down tile game, the players take control of a robber who is sneaking through the maze to get to the treasure chest. However, our robber isn't alone! Throughout the maze, there are several cops patrolling and if they spot our robber they will pick up speed and charge after them. If the cops catch up to the robber, it is game over - so stealth is key to this game!
In today's Guided Hack, we decide to make this game of cat and mouse even more interesting. By adding a key-code into our game that opens up the chest, the robber now has to spend more time looking through the maze for the note containing the code. In addition, once the key-code has been entered into the treasure chest the robber now has to make an escape through one of the 4 starting points - but only one is open and the rest are closed down so don't get cornered by the cops when running for the exit! To do this we code two functions; one which generates the keycode for the player to input and one which creates the escape route for the robber. We also edit the overlapping code for the player sprite and the chest sprite so that instead of rewarding us points upon contact, it will now ask for the code and check if it matches with the randomly generated one.
This Guided Hack gets our coders to consider strings and integers and the difference between them as we code our robber sprite to say the number held in the key-code variable. This takes us onto this week's coding skill: String Casting. In this coding skill, we use a Python function known as casting. This turns a integer (in this case our key-code number) and converts it to a string so that the robber can say it. A very useful Python function to keep in your back pocket for future projects
About The Code Zone Academy
Posts like this one are written by the mentors, about what members have been building. The Game Dev Academy has no fixed session time: a new build goes up every week and a child opens it whenever they are ready, with a STEM-certified mentor answering by text and video message when they get stuck.
Children build their own games rather than following a set course, starting in Scratch. Levels move down as readily as up, and staying where you are is a perfectly good outcome. Every mentor is background-checked and STEM-certified.
The blog is in two halves. Guides are the evergreen explainers written by the mentors who teach the clubs, covering the questions parents actually ask: what comes after Scratch, how to support a coding-mad child when you cannot code yourself, and what works for autistic and ADHD children.
Club news is the other half, and it is where posts like this one live: game jams, Minecraft builds and weekly roundups, written up by whoever ran the session. Neither is marketing. If you want to know what the work actually looks like before you sign up to anything, club news is the more honest read of the two.