While working out last-minute issues with deploying Game Edition Alpha, we’ve used the time to produce a stack of cool sample projects. (I often find it easier to learn from code samples than from documentation, and from what we’ve heard, a lot of our users feel the same way.)
So far, my favorite Game Edition sample code is “SimplePool”, which uses our new physics engine to literally implement an entire game of billiards for iPad in just 200 lines of code!
Better yet, the majority of that code is used to position the objects and initialize their physical properties; the physics engine then takes over and manages most of the game automatically. This is the nice thing about physical simulations: you just need to set them up, and then a lot of rich behavior emerges — basically “for free”.
Here are some screenshots from the Corona Simulator:
We’ll be distributing this code — and a lot more — with the upcoming Game Edition DMG.