Pygame cheatsheets

Load images into surfaces and flipping them too

Rotate an image

Preparing for sounds

Adding a soundtrack

[wip]

Add gravity to a sprite

A scrolling basement class

A class for the background

Making mask syntax memorable

Make this a method of the sprite class you of which you want to detect collision.

If you want to detect collisions with more enemies or object create and call this method in the Sprite class

A class to save maxscore

Create a file called score.py in a folder called functions and in the main file import it like this:

then create an istance of the class Score like this

when you need to save the score (at the game over moment for example), write this:

the score.py file to put into the folder functions is this:

Make a button

Buttons in pygame

Full screen

Make a full screen window with pygame

Post written by Avatar A python enthusiast

Pygame map editor devlog

The devlog of the Pygame map editor. A work in progress to create a map editor to create maps with tiles with an example of a game that uses these maps. The current version is 1.5 of the map editor and 0.2 of the game, not yet ready for the 1.5 version of the editor (16.9.2020). Repository of the map editor