Snake collision based on box2d; refactored collision codes