You can read about how collisions in Box2D work over in this tutorial, but in Moai you will find that a lot of the functions referenced there don't actually exist. There is no way to get the full contact list of everything that is colliding through getContactList(). However, Moai does provide one way to … Continue Reading ››
Box2D is a simple open source 2D physics engine. It was written as part of a GDC talk in 2006, and a lot of famous iPhone games like Angry Birds use it. You can find more information about it over at its website. I also found a great set of tutorials here, which … Continue Reading ››
The previous Moai example I posted before only setup a scene, but it didn't have a main game loop. The main loop can be important if you want to try to do something at a regular interval, like polling for input or advancing some game logic. Here's a basic example … Continue Reading ››
I don't know much about how people typically style their Lua code, but I've picked a few guidelines I'm going to try to stick to. They seem consistent with what the Moai SDK uses, and if you end up working with my code, please try to stick to it: