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
Install Ubuntu 24.04
Hopefully, by now you’ve managed to create and boot H an Ubuntu installation medium. If not, turn back and follow the instructions in the box forthwith. The first thing you see is a brutalist menu from which you should select the first option (Try Or
Linux Format1 min read
Nvk Is Go!
"NVK, the open source Vulkan driver for Nvidia hardware in Mesa, is ready for prime time. The merge request has landed, getting rid of the nonconformant implementation warnings and signalling to distros that it’s now time to start shipping NVK to use
Linux Format12 min read
Let’s Code Some Demos Like It’s 1990!
Ferenc Deák never throws anything away, which is why he still has all his demoscene files. Sadly, it also means his fridge is a no-go zone. It all started when this author’s beloved retro PC, used to host nostalgic gaming sessions, I suddenly suffer

Related Books & Audiobooks