Code for platformer.