Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python Game Programming By Example

You're reading from   Python Game Programming By Example A pragmatic guide for developing your own games with Python

Arrow left icon
Product type Paperback
Published in Sep 2015
Publisher
ISBN-13 9781785281532
Length 230 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Introducing Pymunk


We will implement physics in our game with Pymunk, a 2D physics engine built on top of Chimpunk2D.

Even though we are using OpenGL for 2D graphics, our platformer game will recreate a two-dimensional space, so we will work on the plane in which the z axis equals 0.

You can install Pymunk directly from pip:

$ pip install pymunk

The Chimpunk2D library is written in C, so you might need to compile it on your platform if the distribution does not ship with the precompiled library. On 32-bit Windows and 32-bit and 64-bit Linux versions, Pymunk will include the Chimpunk2D binaries.

For other platforms, or if you want to compile the library yourself, you can check out the installation guide and the steps for compiling Chimpunk2D at http://pymunk.readthedocs.org/en/latest/installation.html.

Tip

Don't reinvent the wheel!

Implementing a rigid body library is a laborious task, especially if you are developing a casual game from scratch—as we are doing in this chapter.

Fortunately, the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime