Pygame - Learn to code games for real

Introducing PyGame, a python wrapper for SDL. A nice tool to start coding videogames for real.

Greetings everybody, let's continue our trip in the world of game development by taking a look at PyGame.

PyGame is nothing else than a wrapper around SDL (Simple DirectMedia Layer) libraries, on Python.

Python is a really nice language, here are some of its features:

  • Cross-Platform: a python code listing can be executed in any operating system (Windows, Linux, MacOS) without needing any editing.
  • Interpreted but not "slow", python uses some tricks coming from compiled languages to make the execution faster. Some variants like PyPy or Psyco use a Just-in-time compiler.
  • Multiparadigm differently from C and ProLogic, which only follow a certain paradigm, Python supports procedural programming (C-style) as well as logic programming (ProLogic).
  • Dynamic Typing: it's not always possible to know a variable type in advance, there is no such issue in Python since the variable will get its type when used, and it's still possible to use C types via CPython, allowing for static typing.
  • Strong Typing: when a variable has a type, that type can't be changed. According to this definition, Python is strongly typed, when a variable has gotten its own type, the interpreter checks for illegal operations (trying to sum a string to an integer doesn't quite make sense)

Pygame is a module that allows to manage SDL and create anything from simple little games to stuff a lot more complex.

To code you can use any text editor, or an IDE like Eclipse or IDLE, an editor included in the Python package.

On the Official Website you can download the package, as well as find lots of tutorials, guides and examples.

Now you just need to start coding.

Have fun everybody!

See you in the next post.