Objective-Chipmunk iPhone tutorial.
Posted: Tue Aug 17, 2010 8:03 pm
I've thrown together a simple Objective-Chipmunk tutorial aimed at iPhone developers:
http://files.slembcke.net/chipmunk/tuto ... eChipmunk/
From it's own description:
http://files.slembcke.net/chipmunk/tuto ... eChipmunk/
From it's own description:
I've included it along with the new Objective-Chipmunk API docs in the new Chipmunk 5.3.1 release.This tutorial aims to be a bare-bones introduction to using Objective-Chipmunk in an iPhone game. It is very heavily commented and should be easy to follow. Despite containing only 100 or so actual lines of code, it squeezes in an overview of a number of topics:
- Creating a Chipmunk space to simulate objects in it
- 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 Chipmunk into a Cocoa Touch UI