Mission Python: Code a Space Adventure Game!

Mission Python: Code a Space Adventure Game! — page 3
parts of the code work so you can customize it or build your own games based on my game code You can also download all the code you need If you get stuck or just want to jump straight into playing the game and seeing it work you can do so All the software you need is free and I’ve provided instructions for Windows PCs and the Raspberry Pi I recommend you use the Raspberry Pi 3 or Raspberry Pi 2 The game may run too slowly to enjoy on the Pi Zero original Model B and older models There are several different ways you can use the book and the game Download the game play it first and then use the book to understand how it works This way you eliminate the risk of seeing any spoilers in the book before you play the game Although I’ve kept them to a minimum minimum you might notice a few clues in the code as you read the book If you get really stuck on a problem in the game you can try reading the code to work out the solution In any case I recommend you run the game at least once to see what you’ll be building and learn how to run your programs Build the game and then play it This book guides you through creating creating the game from start to finish As you work your way through the chapters you’ll add new sections to the game and see how they work If you can’t get the code working at any point you can just use my version of the code listing and continue building from there If you choose this route avoid making any custom changes to the game until you’ve built it played it and finished it Otherwise you might accidentally make the game impossible to complete It’s okay to make any changes I suggest in the exercises Customize the game When you understand how the program works you can change it by using your own maps graphics objects and puzzles The Escape game is set on a space station but yours could be in the jungle under the sea or almost anywhere You could use the book to build your own version of Escape first or use my version of the final game and customize that I’d love to see what you make using the program as a starting point You can find me on Twitter at musicandwords or visit my website at www sean co uk What’s in this Book Here’s a briefing on what’s in store for you as you embark on your mission Chapter 1 shows you how to go on a spacewalk You’ll learn how to use graphics in your Python programs using Pygame Zero and discover some of the basics of making Python programs Chapter 2 introduces lists which store much of the information in the Escape game You’ll see how to use lists to make a map Chapter 3 shows you how to get parts of a program to repeat and how to use that knowledge to display a map You’ll also design a room layout for the space station using wall pillars and floor tiles 2 Introduction