Easy Programming with Python


This article originally appeared on NAG Online.


Code in Python, go to outer space. A simple process, really.

Do you really, really want to become a game programmer? Do you really, really have no idea how to start? Try some Python! This easy and simple programming language is not just a great springboard for people who don’t know much about coding: it’s also a tool that’s gained a considerable following in South Africa over the past few years, and is famously endorsed by Mark “can haz astro-monies!” Shuttleworth.

Code in Python, go to outer space. A simple process, really.

Code in Python, go to outer space. A simple process, really.

Now, while it’s not strictly recommended that you plough straight into the Python language as opposed to, say, firing up Game Maker and fiddling with its script editor, Python is not a bad introduction to programming in its own right. For those who insist upon diving into the world of “pure” coding, it would probably be a good idea to stop off at the Python station before moving in a direction as drastic as C++. It’s a lot friendlier, and arguably a little easier to create games with.

Python is what’s described as “totally freaking simple” by programming veterans. An experienced coder can learn it in an afternoon. A beginner can dip his or her toes into the shallow end for a while, realise that the water is warm and then do a full-on belly flop dive into more complex programming territory.

It’s often used in conjunction with open-source tools such as Blender, and serves as the coding glue that holds Red Hat’s system software together. It was also created by somebody with a sense of humour, so most of the tutorials are pretty cool to learn from, as well.

Bubbman 2, an example of Pygame in action. Find the dev at http://pymike.pynguins.com/

Bubbman 2, an example of Pygame in action. Find the dev at http://pymike.pynguins.com/

From a game developer’s perspective, the cherry on top is the existence of Python game creation libraries, such as Pygame, which extend the language in a way that lets you create all sorts of 2D/3D titles. Pygame is the major Python option for game crafting, doubling as its own dev community that discusses, creates and plays games made with the tool. Spotlights of better games are dotted here andthere to give new users an idea of the tool’s potential.

Is Python the alpha and omega of game design? Not necessarily, but it’s a great way to get comfortable with “full-on” coding environments in a way that will demonstrate how fun and easy programming can be. So if you want to go “pure” and are eyeing C++ in place of a rapid game development toolkit, do yourself a favour and learn Python first. It’s a joy to use, and at the very least will serve as a great stepping stone on the way to all that programming high sorcery.

Check out some Python downloads and beginner’s guides to help you get started, and look over here for Pygame downloads and tutorials!


About Nandrew

Rodain Joubert is a South African game developer based in Cape Town, currently working for QCF Design. He likes his job. He likes being opinionated on the Internet. He likes fighting evil with his heat ray vision. And he also likes cats. [Articles]