Adding tile collision detection (fixes #11).