PyGame Basics: Keyboard Input

In this guide, we will take a look at a couple ways to gather keyboard input with PyGame. There are a few ways of grabbing keyboard input. The first way to gather keyboard input is via capturing PyGame events. To check if any arrow keys are pressed down on the current update, you can write: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False if event.type == pygame.KEYDOWN: if event....

October 5, 2019 · 2 min · Jared

PyGame Basics: Image Effects

In this guide, we will be taking a look at some different image effects you can use within your PyGame. In the examples below, I will be drawing sample images at x: 480 and y: 128. To learn how to position images, you can take a look at this guide of ours. Scaling Images You can scale images with PyGame using the pygame.transform.scale method. This method, like the other methods part of pygame....

October 3, 2019 · 3 min · Jared

PyGame Basics: How to Setup PyGame

Before we jump into building a game, we will need to setup PyGame. Since PyGame requires Python, we will need to ensure it’s installed first. This tutorial series assumes you will be using Python 3. You can download and install Python 3 from the official website. Installing PyGame If you’re running Linux, ensure the python3-pip package is installed. Once you have Python installed, we can setup PyGame. Open your command prompt or terminal and run:...

October 1, 2019 · 2 min · Jared