The Design and Implementation of a Lightweight Game Engine for the iPhone Platform