avatarManpreet Singh

Summary

The website provides a tutorial on developing an Angry Birds game using Python and Pygame, with a walkthrough of the project structure, instructions for running the game, and encouragement for readers to explore game development with Python.

Abstract

The article "Build Angry Birds with Python!" introduces Python's capabilities in game development through a practical example: a clone of the popular game Angry Birds. It highlights the use of Pygame, a set of Python modules designed for writing video games, and references an open-source project on GitHub that serves as a basis for the tutorial. The project's structure is detailed, pointing out the main Python files responsible for generating the game's levels, characters, and polygons. Readers are guided through the steps to install necessary packages, run the game, and are encouraged to study the code to understand Python's potential in game development. The author also invites feedback and engagement on social media and provides a link to recommended learning resources.

Opinions

  • The author expresses enthusiasm about Python's versatility, particularly for game development.
  • They recommend Pygame as a tool for game development and provide a link for further information.
  • The author encourages giving credit to the original project's author when using the GitHub repository.
  • They suggest that readers should not only run the game but also read and understand the code to learn more about Python and game development.
  • The author is open to community interaction and offers resources for those interested in programming, Python, R, and Data Science.

Build Angry Birds with Python!

Welcome back! Python is a very versatile language with tons of capability, one of the awesome things you can do with Python is game development, so let’s take a look at an awesome Python game development project. This specific project was built using Pygame, a very popular Python project used for game development, if you want to learn more about Pygame, check out the link below:

This specific project that we’re looking at is hosted on Github, to view this project check out the link below (please give full credit to the author of this project):

Let’s go ahead and do a high level overview of this specific project.

The Code

This project is broken down into several different files:

You have the resources folder, the src folder, a license file, a read me file, a config yml file and a requirements.txt file. Within the src folder we will find several Python files, these are the main files we will be interacting with:

Within each of these Python files house separate components of this game, the main.py file is the one we will be running, within this file we will find calls to other Python files in this folder. Essentially, the level.py file will generate the level, the characters.py file will generate the character and the polygon.py file will generate the polygons of this game. That is a very high level overview of this specific project, so let’s get into the fun part!

Running The Code

First off, we need to install all of the requirements for this project, so open up the requirements.txt file and install the packages within that file. Next up we want to open up our terminal / command prompt and change the directory to that folder:

Next up we want to run that Python file, using Python 3 do the following command:

python3 main.py

Awesome! You will then see the pygame window open and display the Angry Birds game! Below is a screenshot of this game running!

Congrats! I would highly recommend reading through the lines of code within this file and trying your best to understand this code. This project showcases the capiblity behind Python with game development, did you run this project? Do you plan on developing games with Python? I would love to hear your thoughts about this!

As Always

if you have any suggestions, thoughts or just want to connect, feel free to contact / follow me on Twitter! Also, below is a link to some of my favorite resources for learning programming, Python, R, Data Science, etc.

Thanks so much for reading!

Python
Programming
Coding
Gaming
Game Development
Recommended from ReadMedium