Python Programming/Game Programming in Python

From Wikibooks, open books for an open world
Jump to navigation Jump to search


3D Game Programming[edit]

3D Game Engine with a Python binding[edit]

pyirrlicht
ctypes python module for Irrlicht Engine SDK.
PyPi Link https://pypi.python.org/pypi/pyirrlicht
Pip command pip install pyirrlicht
  • Irrlicht Engine[1] (Python binding website: [2] )

Both are very good free open source C++ 3D game Engine with a Python binding.

  • CrystalSpace is a free cross-platform software development kit for real-time 3D graphics, with particular focus on games. Crystal Space is accessible from Python in two ways: (1) as a Crystal Space plugin module in which C++ code can call upon Python code, and in which Python code can call upon Crystal Space; (2) as a pure Python module named ‘cspace’ which one can ‘import’ from within Python programs. To use the first option, load the ‘cspython’ plugin as you would load any other Crystal Space plugin, and interact with it via the SCF ‘iScript’ interface .The second approach allows you to write Crystal Space applications entirely in Python, without any C++ coding. CS Wiki

3D Game Engines written for Python[edit]

Engines designed for Python from scratch.

Blender
Open Source 3D creation. Free to use for any purpose, forever.
Download link https://www.blender.org/download/
  • Blender is an impressive 3D tool with a fully integrated 3D graphics creation suite allowing modeling, animation, rendering, post-production, real-time interactive 3D and game creation and playback with cross-platform compatibility. The 3D game engine uses an embedded python interpreter to make 3D games.
Panda3d
Panda3D is a game engine, a framework for 3D rendering and game development for Python and C++ programs
Download link http://www.panda3d.org/download.php
  • Panda3D is a 3D game engine. It's a library written in C++ with Python bindings. Panda3D is designed in order to support a short learning curve and rapid development. This software is available for free download with source code under the BSD License. The development was started by [Disney]. Now there are many projects made with Panda3D, such as Disney's Pirate's of the Caribbean Online, ToonTown, Building Virtual World, Shell Games and many others. Panda3D supports several features: Procedural Geometry, Animated Texture, Render to texture, Track motion, fog, particle system, and many others.
Crystal Space
Crystal Space is a mature, full-featured Software Development Kit (SDK) providing real-time 3D graphics for applications such as games and virtual reality
Download link http://www.crystalspace3d.org/main/Download

2D Game Programming[edit]

Pygame
Python Game Development
PyPi Link https://pypi.python.org/pypi/Pygame
Pip command pip install Pygame
  • Pygame is a cross platform Python library which wraps SDL. It provides many features like Sprite groups and sound/image loading and easy changing of an objects position. It also provides the programmer access to key and mouse events. A full tutorial can be found in the free book "Making Games with Python & Pygame".
pgu
Python Game Utilities
Download link https://code.google.com/archive/p/pgu/downloads
Dependencies PyGame
  • Phil's Pygame Utilities (PGU) is a collection of tools and libraries that enhance Pygame. Tools include a tile editor and a level editor (tile, isometric, hexagonal). GUI enhancements include full featured GUI, HTML rendering, document layout, and text rendering. The libraries include a sprite and tile engine (tile, isometric, hexagonal), a state engine, a timer, and a high score system. (Beta with last update March, 2007. APIs to be deprecated and isometric and hexagonal support is currently Alpha and subject to change.) [Update 27/02/08 Author indicates he is not currently actively developing this library and anyone that is willing to develop their own scrolling isometric library offering can use the existing code in PGU to get them started.]
pyglet
Cross-platform windowing and multimedia library
PyPi Link https://pypi.python.org/pypi/pyglet
Pip command pip install pyglet
  • Pyglet is a cross-platform windowing and multimedia library for Python with no external dependencies or installation requirements. Pyglet provides an object-oriented programming interface for developing games and other visually-rich applications for Windows, Mac OS X and Linux. Pyglet allows programs to open multiple windows on multiple screens, draw in those windows with OpenGL, and play back audio and video in most formats. Unlike similar libraries available, pyglet has no external dependencies (such as SDL) and is written entirely in Python. Pyglet is available under a BSD-Style license.
kivy
A software library for rapid development of hardware-accelerated multitouch applications.
PyPi Link https://pypi.python.org/pypi/kivy
Pip command pip install kivy
Dependencies docutils; pygments (auto-installed with kivy)

kivy.deps.sdl2; kivy.deps.glew (will not auto-install, run pip install kivy.deps.sdl2 kivy.deps.glew, needed for OpenGl) kivy.deps.angle (Python3.5+, can be substituted for kivy.deps.glew pip install kivy.deps.angle) kivy.deps.gstreamer (120+mb, needed for video/audio, pip install kivy.deps.gstreamer, not needed for graphics only)

kivy_examples (Optional, install with pip install kivy_examples
  • Kivy Kivy is a library for developing multi-touch applications. It is completely cross-platform (Linux/OSX/Win & Android with OpenGL ES2). It comes with native support for many multi-touch input devices, a growing library of multi-touch aware widgets and hardware accelerated OpenGL drawing. Kivy is designed to let you focus on building custom and highly interactive applications as quickly and easily as possible.
Rabbyt
A fast 2D sprite engine using OpenGL
PyPi Link https://pypi.python.org/pypi/Rabbyt
Pip command pip install Rabbyt
  • Rabbyt A fast Sprite library for Python with game development in mind. With Rabbyt Anims, even old graphics cards can produce very fast animations of 2,400 or more sprites handling position, rotation, scaling, and color simultaneously.


See Also[edit]