Linux Format

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.

More from Linux Format

Linux Format5 min read
Tips For Managing Docker Containers
Everyone knows how containers revolutionised application building and deployment. Using a E disposable stack of containers that make up an app that aren’t using the docker-compose command to manage the stack are missing a trick. It allows the shippin
Linux Format1 min read
Installation Complications
The Linux Mint system package for Timewarrior was out of date, so we installed the latest version from Snap. The Hamster package in the distribution repository was the latest stable release (which is quite old), but we could also have installed via F
Linux Format3 min read
Drauger OS 7.6
We love the idea of a gaming-specific version of Linux, but Drauger fails to deliver. Given the setup/kernel issues, you’re far better off installing Ubuntu, then adding gamingspecific packages yourself. CPU: 1.8GHz (2GHz suggested) Mem: 1GB (6GB sug

Related Books & Audiobooks