Hint: You can adjust the default video playback speed in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Make a 2D Side-Scroller Game With PyGame (Overview)

In this course, you’ll learn about creating games using Python and the library PyGame.

By the end of this course, you’ll be able to:

  • Draw items on your screen
  • Play sound effects and music
  • Handle user input
  • Implement event loops
  • Describe how game programming differs from standard procedural Python programming

This primer assumes you have a basic understanding of writing Python programs, including user-defined functions, imports, loops, and conditionals. You should also be familiar with how to open files on your platform. A basic understanding of object-oriented Python is helpful as well. pygame works with most versions of Python, but Python 3.6 is recommended and used throughout this article.

Download

Sample Code (.zip)

422.6 KB

Download

Course Slides (.pdf)

7.6 MB

Comments & Discussion

Tomas Menito on April 9, 2020

Hi, I’m enjoying a lot the course!

I noticed that “Sample Code (.zip)” contains files from Arduino course, and not pygame course.

Dan Bader RP Team on April 9, 2020

@Tomas: Thanks for the heads up. I just fixed the download, when you try again you’ll get the correct file :)

Andreas on May 13, 2020

Just a quick heads up for my fellow Mac folks. I was not able to get anything to draw on the screen, when I found this post on slack overflow. Basically on Catalina you need to utilize: pip3 install pygame==2.0.0.dev4 to get things working. Hope that helps others!

Become a Member to join the conversation.