A tile based game engine in AS3