Platformers in Python
Side-scrolling video games are usually action based, with a side-view perspective on a player character traversing a two-dimensional world. As the character moves left or right, the game world moves with them. Timeless classics include Sonic The Hedgehog and Super Mario Bros. More contemporary takes would include Broforce, Super Meat Boy, Braid, Rayman Legends, Limbo… all fantastic titles!
There’s a debate to be had about the first side-scrolling arcade game, released sometime in the 1970s, but the first game to enable the world to extend beyond a single screen was 1981’s Defender, a side-scrolling shooter. Before this worlds were restricted to a single screen, showing only what was on the monitor. A game called Jump Bug came out that same year, which was the first side-scrolling platform shooter, offering players the ability to jump on platforms, with levels that scrolled now only horizontally but also vertically.
For our game, we’re going to dial things down a step and work with 2D shapes to begin with. This project is all about getting the game world, player character and relevant physics programmed. Let’s start by loading up Python IDLE or your favourite text-based editor and setting up the basic parameters for our game world:
Pygame is a module that offers
You’re reading a preview, subscribe to read more.
Start your free 30 days