I created JavaScript bindings for Chipmunk v6.1.1.
The generated JavaScript API is compatible with the Chipmunk-JS project ( https://github.com/josephg/chipmunk-js )
That means, that if you create a Chipmunk project using the JS API:
- it can run on mobile devices / PCs at native speed (by using the Chipmunk JS bindings)
- or it can run on the web (by using the Chipmunk-JS)
Bugs / Features / Status:
Features:
- Currently it supports all the basic Chipmunk functionalities like, Space, Body, all types of shapes, all types of joints, collision detection callbacks.
- The API is 95% compatible with the Chipmunk-JS project. It still has some small incompatibilities which I will try to fix in the next days / weeks.
- The JS code is executed by the SpiderMonkey VM (bundled with the project).
- Supported Platforms: Although in theory should work (with little changes) on every Chipmunk supported platform it was tested only on OS X and iOS. Android version coming soon.
- For the moment there is no documentation, but the easiest way to start a Chipmunk + JS Bindings project is by downloading cocos2d-iphone (develop-v2 branch) ( https://github.com/cocos2d/cocos2d-iphone/ ), install the Xcode templates, and start a "cocos2d iOS with JavaScript" project (it includes the Chipmunk JS bindings as well).
- The bindings are automatically generated. So it should be easy to update them in case new features are added to the C Chipmunk library.
- Status: Alpha. Early adopters are welcome!
This project is part of a bigger project to create multiplatform games in JS using Chipmunk as the physics engine, and cocos2d as the game engine.
Info: https://github.com/cocos2d/cocos2d-ipho ... JavaScript
Sample game:
- From cocos2d-iphone (develop-v2)
https://github.com/cocos2d/cocos2d-ipho ... with_me.js