To write computer games (us oldies call them video games!), you may be wondering, “Where do I start?” To make a playable game in a decent timeframe while also learning how the program works, you will need a game framework. The framework creates many of the constructs that you will need for your games to function. You do not want to invent these yourself. These include how to draw anything to screen, how to detect a collision, and how to keep the score.

Even making things move on the screen is complex without some underlying library. In this article, you will learn about which packages do what and how easy it is to get started on your game.

Why Game Engines?

When you begin programming your game, you will appreciate the power of having all the basics ready, such as classes and functions. This way, you can get started and focus on the particulars of your project. You may wonder what the difference is between a framework and a game engine. On a high level, the game engine implements all the fast operations – mostly graphics. The framework implements the logic, the things you want to put in your game – the story, if you will.

PyGame

This is a set of Python Modules. This set of modules is deliberately small to make it easy to get started. The designers have also decided to create many small pieces within the library. Thanks to this design, you may swap parts of the library out whenever your needs change. The mixer, for example, is a separate piece of software; so if you get more advanced in your programming, you can switch to another piece of software. The graphics rendering machine is also separate, and so on. In fact, you could use PyGame to prototype a game and transition one piece at a time to more advanced software. With that said, PyGame has a large number of games under its name already.

Getting started with PyGame is easy but you can make it even easier. The pgzero package is made for teachers to show programming. With the package, you can easily write many parts of your game without boilerplate code.

Kivy

You may install Kivy as Python modules also. This is the best way to use Python for any framework. Kivy has more features than PyGame and creates more polished results. To get started, Kivy has great tutorials right on their homepage. One strength ov Kyvi is their Kv Design language. This design language makes it easy to create menus, game plan and all graphics. Thanks to this system, you do not need to create images for the simplest graphics.

On their page, they also detail how to get started using Kivy with PyCharm. There are also extensions for deploying to Android and iOS. This is a bit easier than using PyGame.

pyglet-3D

At first glance, pyglet seems small and limited, but there is depth hiding under the simplicity. This program supports OpenGL, while having no dependencies, though you can extend media capabilities by calling ffmpeg. Pyglet also handles dual-monitor setups. There are third-party libraries available that extend the system. You should know about these libraries for all the features they add. You may also want to use glooey to make a consistent GUI for your application. Use PyShaders for the rendering and Ratcave for handling 3D scenes. If you start with pyglet3d, it is good to know that cocos2d uses pyglet. This program builds a comprehensive framework for game apps and other GUI-based applications.

Panda3D

This is not a package you can use to learn programming or to make a game easily. What you get here is a professional tool for creating animations and games. Panda3D is written in C to safeguard performance. Most of the manual, however, points to Python users. While the idea behind Panda3D is for game developers to make their games using Python, you can also use C .

Panda3d is a very capable system and even comes with its own SDK. If you are willing to put in the effort, and you already know some Python programming, this system is already far beyond anything you want to create. After all, Disney is using it for their commercial products!

Ren’Py

You probably read this post because you want to create games. This package is for creating visual novels. If you have not thought through your project idea yet, now is the time. You may want to make a story-based game that requires a narrative format. This is what Ren’Py is for.

There are already many commercial games written in Ren’Py and there will be more to come. You can also create a visual novel and make it a game. With Ren’Py, you can create the whole thing using mostly text editors.

Ursina to Enhance Panda

If you find Panda lacking in some way, try using Ursina. This is a single developer project, so do not depend on this package for bigger projects, unless you are willing to contribute. Having said that, Ursina is an enhancement to Panda3D. The project is also very active and there are several people who contributed to it.

Making a game with this framework is very easy and done in very few lines of code. If you feel that your project might expand, do not worry. This program is built on Panda, so when your needs increase, you can use any of the Panda3D functions. This gives you fast take-off alongside the power of an established system.

Conclusion

To begin learning and using a new game developing framework, pick a few tutorials and run through them. Do not pick too many, you will just be wasting your time. Start any simple project, decide on very few features, and try to make them work together. By the time you have finished one project, you will have a thousand ideas for the next one. Your choice of game engine is not that vital, as long as you re-evaluate your choice early enough. This is to make the eventual transition to a better one less complex and more efficient.

About the author

Best Python Game Engines Games Python

Mats Tage Axelsson

I am a freelance writer for Linux magazines. I enjoy finding out what is possible under Linux and how we can all chip in to improve it. I also cover renewable energy and the new way the grid operates. You can find more of my writing on my blog.