Skip to content

Commit

Permalink
Fixed bug where all contacts were deemed standard
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Pierce committed Mar 30, 2020
1 parent f34818b commit 69e8143
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Ball.pde
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class Ball {
float dist = sqrt(dx*dx+dy*dy);
boolean currentCanMove = velocity.x != 0.0 && velocity.y != 0.0;
boolean otherCanMove = other.velocity.x != 0.0 && other.velocity.y != 0.0;
if(dist < Constants.Simulator.RADIUS + Constants.Simulator.RADIUS) {
if(dist < Constants.Simulator.RADIUS + Constants.Simulator.RADIUS && currentCanMove && otherCanMove) {
updatePosition(other,dx,dy);
updateInfected(other);
} else if (dist < Constants.Simulator.RADIUS + Constants.Simulator.RADIUS && currentCanMove && !otherCanMove) {
Expand Down

0 comments on commit 69e8143

Please sign in to comment.