Take inspiration from the golden age of video games and learn how to write your own modern classics.
Code the Classics Volume 1 not only tells the stories of some of the seminal video games of the 1970s and 1980s, but shows you how to create your own games inspired by them, following examples programmed by Raspberry Pi founder Eben Upton. In this book, you'll learn how to run and edit the games in this book by installing Python, Pygame Zero, and an IDE. You'll also:
Get game design tips and tricks from the masters
Learn how to code your own games with Pygame Zero
Explore the code listings and find out how they work
You'll meet these vintage-inspired games, and learn from their code in between rounds of play:
Boing!: all it took was a couple of lines and a dot, and gamers would be queuing up to play.
Cavern: Enduringly popular, the platform game genre is still packed with creative possibilities.
Infinite Bunner: Play around with the benefits that a top-down perspective can lend to the classic platform genre.
Myriapod: Some shooters confine the gameplay to a single screen while limiting the player's movement. Restrictions can build challenge and difficulty, making for truly addictive gaming.
Substitute Soccer: Top-down games of pinball-style soccer built a huge cult following and kicked off a sports genre that's still going strong. To show how a game like Pong can be coded, we’ve created Boing! using Pygame Zero, a beginner-friendly tool for making games in Python. It’s a good starting point for learning how games work – it takes place on a single screen without any scrolling, there are only three moving objects in the game (two bats and a ball), and the Artificial Intelligence (AI) for the computer player can be very simple – or even nonexistent, if you’re happy for the game to be multiplayer only. In this case, we have both single-player and two-player modes. The code can be divided into three parts. First, there’s the initial startup code. We import from other Python modules so we can use their code from ours. Then we check to make sure that the player has sufficiently upto-date versions of Python and Pygame Zero. We set the WIDTH and HEIGHT variables, which are used by Pygame Zero when creating the game window. We also create two small helper functions which are used by the code below.
To see this hidden content, you must reply and react with one of the following reactions : Like