How to Code a Level Editor Using Python! (Pygame Platformer Level Creator)

How to Code a Level Editor Using Python! (Pygame Platformer Level Creator)

L
LeMaster Tech
40 Video Views·Apr 23, 2025

To create a Platformer game in python, one of the most important things is being able to quickly create, design build and edit your levels for the game!!

If you want to be a super supporter of the channel check out the Patreon link to my page here:
https://www.patreon.com/LeMasterTech

And feel free to grab the code and images from this tutorial here:
https://github.com/plemaster01/pygamePlatformer_LevelEditor

Believe it or not, a level editor is a really cool project on its own, and pretty fun to use once created!! You go through the same steps of loading in all your images for the different tiles and setting up a PyGame game board as you would in your actual game, but the only 'player' controls you need for a level editor are the ability to change tile assignments using the mouse!

We then set it up to display the board you've just created to the console window so you can copy good levels into your main game!

The full platformer using the tiles you see in this video is coming in the next week so be sure to check out the channel for tons of great content, and subscribe and turn on the bell to make sure you don't miss any great future projects!!

TIMESTAMPS:
00:00 Intro and Project Showcase
03:08 Basic Pygame Project Set up
06:23 Platformer Tiles Needed
08:22 Loading in the images
12:35 Creating tile and image lists
16:00 Set Up Your Main Game Loop
17:43 Draw Board Tiles onto the screen
25:00 Event handling for tile changes
31:35 Export board level array to window
36:01 Outro

Thanks for watching and goodluck with your code!