Prevent AI from moving off screen.
Fix for holding down multiple keys.