float PLAYER_SIZE = 10; float CHASER_SIZE = 10; float LIGHT_ANGLE = PI / 6; float BEAM_LENGTH = 768; float CHASER_SPEED = 0.4; float CHASER_TURN_RATE = 0.03; float CHASER_STEERING_TOLERANCE = 0.11; float BURN_RATE = 0.004; float PLAYER_SPEED = 0.5; float getAngleDifference(float angle1, float angle2) { float difference1 = (angle1 + TWO_PI) % TWO_PI - (angle2 + TWO_PI) % TWO_PI; float difference2 = (angle2 - angle1); if (abs(difference2) > abs(difference1)) { return difference1; } else { return difference2; } }