Stop crashing on illegal movements
Extract collision detection and refactor