README.md 2.4 KB

Pygame snippets and random code

This repository contains several Pygame games. Some of them are useful to reuse and to extend, other are just text snippets with test code.

Games

In this section, all the games are listed and described. For instructions on how to run the games, read the src/README.md file.

Index

  1. Empty window
  2. Full screen
  3. Transparent rectangle
  4. Cat animation
  5. Jumping square
  6. Bullet dodger
  7. Repeating background

Empty window

Just a base Pygame window. It has an icon and a title, but it's empty.

Empty window

Full screen

A game in which you can toggle between normal and full screen mode pressing F11. The hardest part of the game comes when you're in full screen mode. You must exit this mode pressing the Escape button.

Fullscreen (normal mode) Fullscreen (fullscreen mode)

Transparent rectangle

Just a transparent rectangle. There is some text behind it.

A transparent background made with Pygame

Cat animation

A walking cat. It never stops.

A walking cat

Jumping square

A square that jumps when you press the up arrow key (UP).

A square that jumps

Bullet dodger

A fun and challenging mouse game where you must dodge bullets. How many points will you get?

Bullet dodger

Repeating background

This code creates a background with a image smaller than the window's resolution. It works by repeating the image until the background is filled.

Repeating background