Chipmunk2D Documentation:

Chipmunk2D Manual

The manual goes over all of the different parts of Chipmunk2D, explaining how they they work and how to generally use Chipmunk2D. The manual is C-centric, though nearly all of the information is applicable Objective-Chipmunk2D. Because the C API is written in an object oriented style already, there is generally a pretty close 1:1 relationship making it very easy to find the corresponding method in Objective-Chipmunk2D.

Chipmunk2D API Reference

The Doxygen generated API reference covers everything in Chipmunk2D and Chipmunk2D Pro (Objective-Chipmunk2D, Autogeometry, etc).

Chipmunk2D For Unity

All documentation for the Unity3D bindings are located in this manual.


Simple Objective Chipmunk2D Tutorial: (Objective-Chipmunk2D/UIKit)

  • Creating a Chipmunk2D space to simulate objects
  • Creating a bouncing box with friction
  • Controlling gravity using the device's tilt
  • Using collision callbacks to make impact sounds based on how hard objects collide
  • Using collision callbacks to track if an object is sitting on the ground or in the air
  • Using the ChipmunkObject protocol to easily add complex objects to a space
  • Using a CADisplayLink for smooth animation
  • Integrating Chipmunk2D into a Cocoa Touch UI

Chipmunk2D Color Match:

  • Tutorial available for: Chipmunk2D Pro and Cocos2D
  • Four separate examples so you can use any libraries you want.
  • Example code for Chipmunk2D Pro and UIKit, Chipmunk2D Pro and Cocos2D, Chipmunk2D and UIKit, and Chipmunk2D and Cocos2D.
  • A full game tutorial - a simple color matching game
  • Collision callbacks
  • Use of CCPhysicsSprite and CCDebugNode

Top-Down, Tile-Based Game Tutorial: (Objective-Chipmunk2D/Cocos2D)

  • Using Cocos2D and Chipmunk2D Pro together
  • Simulating top-down friction
  • Controlling a top-down player with joints
  • Using Chipmunk2D Pro's autogeometry to create collision geometry for a tilemap
  • This tutorial extends Ray Wenderlich's tile-based game tutorial

Other Tutorials:

  • Ray Wenderlich's excellent Simple iPhone Game with Chipmunk2D is probably the best place to start for someone who is new to programming with a physics engine. Ray covers the basics of what Chipmunk2D does and how to use it with Cocos2D.
  • Heyalda's Getting started with Chipmunk2D and Cocos2d - A nice guide for complete beginners, as it covers how to download and setup Cocos2D, use XCode a bit, and it covers basic terminology and concepts you'll need while working with Chipmunk2D and Cocos2d.
  • Heyalda is back with a Ragdoll Tutorial - Covers the Chipmunk2D joints for a ragdoll, Cocos2D retina display issues, and it uses CCSpriteBatchNode to draw the character.
  • Dirk Johnson has a Guide to Ruby and Chipmunk2D - Although it's from early 2012, it covers using Chipmunk2D from Ruby.
Example Code

Chipmunk2D Demo App: (C / Mac / Windows / Linux)

Check out the Demo application bundled with the standard Chipmunk2D distribution as well as the embedded examples in the documentation.

Chipmunk2D Showcase App: (Objective-Chipmunk2D / UIKit / OpenGL ES 2)

The Chipmunk2D showcase app takes full advantage of Chipmunk2D Pro to provide a high performance demo app on iOS while showing you how simple using it can be. The code is available from GitHub.

Cloud Bomber: (Objective-Chipmunk2D / Autogeometry / Cocos2D 2.1)

  • Integrate Objective-Chipmunk2D with Cocos2D 2.1 using the new CCPhysicsSprite and CCPhysicsDebugNode classes.
  • Implement deformable terrain using a ChipmunkBitmapSampler subclass that is backed by Cocos2D rendering. This is very easy for small terrain that changes rarely. Not as good for large terrain, or terrain that changes rapidly. (More demos to come to cover that).
  • Render holes in a CCRenderTexture necessary to render the terrain.

Gemeralds Pinball: (Objective-Chipmunk2D / Autogeometry / Cocos2D 2.1 / CocosBuilder)

  • Use CocosBuilder to create a level and then make Chipmunk2D collision geometry for it automatically at runtime.
  • Integrate Objective-Chipmunk2D with Cocos2D 2.1 using the new CCPhysicsSprite and CCPhysicsDebugNode classes.
  • Make a pinball game including how to make the physics for flippers and bumpers.

Space Patrol: (Objective-Chipmunk2D / Autogeometry / Cocos2D 2.1)

  • Implement extremely large scale, and highly efficient deformable terrain. The terrain in this demo is initialized from a 12 KB png file and produces smoothly deformable terrain that is over 128,000 pixels wide on a retina scale display.
  • Efficient terrain and parallax rendering in a single pass using pixel shaders.
  • Efficient terrain geometry generation using a tile cache.
  • Efficiently update the terrain detail texture using glTexSubImage2D().
  • Set up car physics for a dune buggy including motor and braking controls.
  • Manually sync sprites to a complicated articulated model for pixel perfect alignment.

Angry Chipmunks: (Objective-Chipmunk2D / Cocos2D 2.1)

  • Create a GameObject class to help bind Cocos2D sprites and physics objects together and easily manange them.
  • Use the integrated CCDebugNode and CCPhysicsSprite classes.
  • Use the ChipmunkObject protocol to easily manage composite physics objects.
  • Use collision handlers to recieve collision events from the physics system.
  • Create breakable physics objects.
  • Use layers to put physics objects inside of each other.
  • Estimate the path of an object and where and when it will first collide with something.

Deformable Chipmunk2D: (Objective-Chipmunk2D / Autogeometry / Mac)

This project shows you a number of things that you can do with Chipmunk2D Pro's Autogeometry features without a lot of effort.
  • Converting images into collision outlines for level terrain as well as creating convex hulls for sprites.
  • Create infinite, procedural, deformable caves using a minimal amount of RAM.
  • Fast, real-time, editable, deformable terrain using drawing contexts.
You can see these demonstrated this YouTube screencast.

Jelly Chipmunk: (Objective-Chipmunk2D / Mac)

Simple example showing how to perform blob / jelly physics. The blob can be grabbed with the mouse using Objective Chipmunk2D's ChipmunkMultiGrab class, or rolled using the arrow keys.

MultiTouchObjectiveChipmunk: (Objective-Chipmunk2D / Cocos2D 2.1)

Very simple Cocos2D example showing how to do multi-touch physics using Objective-Chipmunk2D's ChipmunkMultiGrab class.

iPhoneSnap (Objective-Chipmunk2D / UIKit)

Simple physics based board game using Objective-Chipmunk2D and UIKit. Shows how using Objective-Chipmunk2D / UIKit can be very effective and simple for games with low performance requirements. Using UIKit for a game like this that stops animating between turns is also a terrific way to cut down on battery usage.

Chipmunk2D Geometry Tracer: (C / Autogeometry / Mac)

This example shows how to create a simple command line tool to export geometry for an image. It uses ImageIO to load any sort of image that OS X knows how to load. It can be easily integrated into your project as a build phase to automatically trace your images when running a build.