Common code for "The Chaos Platformer"