Python Pygame

Welcome to part 2 of my introduction to the Python programming language.

The focus of this part will be on making some simple computer games through the use of a graphical library known as Pygame. To proceed with this section, you will need Python running on your own computer with a proper editing program such as Jetbrains Pycharm. Fortunately, Jetbrains make a community edition version of the product the release for free.

Coordinate system

Pygame is a graphics system for Python. The screen is divided into pixels. You use sets of pixel coordinates to tell Python where to draw shapes, place text or images etc.

Pygame coordinates start with the top-left of the screen being (x=0,y=0).

The x-axis increases as you move to the right.

The y-axis increases as you move down – this is different to the way you do it in Maths so be aware of that!

Screenshot