Skip to content

Commit

Permalink
decrease bot_crashing_distance
Browse files Browse the repository at this point in the history
  • Loading branch information
rttwente committed Jun 28, 2024
1 parent 3fdd152 commit 4fe0cd0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public class BotCrashingValidator implements RuleValidator {

private static final float BOT_CRASH_DISTANCE = 0.2f;
private static final float BOT_CRASH_DISTANCE = 0.005f;
private static final float SPEED_VECTOR_THRESHOLD = 1.5f;
private static final float MIN_SPEED_DIFFERENCE = 0.3f;
private static final double GRACE_PERIOD = 2.0;
Expand Down Expand Up @@ -111,7 +111,7 @@ public RuleViolation validate(Game game) {
Vector2 robotBlueVel = robotBlue.getVelocity().xy();
float distanceBetweenRobots = robotYellowPos.distance(robotBluePos);

if (distanceBetweenRobots <= BOT_CRASH_DISTANCE) {
if (distanceBetweenRobots <= robotYellow.getRadius() + robotBlue.getRadius() + BOT_CRASH_DISTANCE) {
// projection length of difference between speed vector
float crashSpeed = calculateCollisionVelocity(robotBluePos, robotBlueVel, robotYellowPos, robotYellowVel);

Expand Down

0 comments on commit 4fe0cd0

Please sign in to comment.