Mission Python: Code a Space Adventure Game!
By Sean McManus
2018, No Starch Press, 280 pages, $20.36
This book explains how you can build a space-themed game in Python. The book’s description implies, but doesn’t actually come out and say, that it is intended for beginners. Although the book is designed for beginners, its eventual goal is still ambitious enough to give even intermediate programmers a challenge. (I’ll say more about that near the end.)
The book explains the basic Python concepts that you need to build the game. For example, it covers lists, variables, strings, loops, functions, and dictionaries.
In addition to explaining how to use Python, the book describes a few useful game-design concepts. For example, it uses collections of images to provide simple animation for things like doors opening and closing, and it uses 20 images to show the astronaut main character walking left, right, up, and down.
In the finished game, you need to move the astronaut through a series of rooms containing bitmapped objects such as walls, chairs, tables, and toilets. You need to avoid obstacles such as closed doors, moving energy balls, and puddles of toxic sludge. On the way, you can pick up useful items such as keys, air canisters, and yo-yos. The graphics are simple and the 3-D effects aren’t very convincing, but the final result is playable and surprisingly fun. Any beginner who works through the book and successfully builds the game has every right to feel proud of that accomplishment!
Overall, I call the book a win, but there are two areas where I think it could have done better.
First, the book does not cover classes. Classes are critical for modern programming and game programming in particular. This book’s game includes several items such as moving energy balls, doors, and toxic puddles that would have made great examples of classes. Instead of using classes, however, the book uses an assortment of lists. For example, large lists contain information about scenery and props by providing indices into an even larger list of objects. It works, but in some ways it feels a bit like FORTAN circa 1980.
My second complaint is that the game may be a bit ambitious for many beginners. The book’s “Age Range” says that it is appropriate for ages 12 and up. I’ve known some 12-year-olds who could work through this book on their own, but I’ve known many others who would have trouble staying focused long enough. The book sometimes requires you to write a fair bit of code without providing immediate results. I know from programming with kids that some kind of immediate results are necessary to keep beginners interested and focused in a project. It also lets beginners know that they are on the right track. Real-world programming often includes stretches without much in the way of results, but it can push a beginner’s attention span to the breaking point, particularly for younger readers.
You can reduce this problem by working in a kid/parent team, tackling the book in limited chunks. You would learn about Python, have a fun game to show off when you’re done, and spend some quality screen time together. Used in that way, the book would be a fun learning experience.
In conclusion, I recommend this book for three audiences: Python beginners with strong attention spans, kid/parent teams, and intermediate Python users who want to tackle a reasonably large, fun, and challenging project. If you don’t fall into one of those categories, then you might be better off starting with a more basic introduction to Python.