Skip to content

Commit

Permalink
Completed new collision algorithm, is messy
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Bell committed Mar 1, 2015
1 parent 888322e commit 6865f83
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/src/ca/michaelbell/gameobjects/collisionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ public void update() {
for (int b = 0; b <= trailList.size(); b++) {// for each square, go through the first squares trail segments
boolean actualPositive = true;
Vector2[] vect;
if (b != trailList.size()) {
vect = trailList.get(b);
} else {
if (b == trailList.size()) {
vect = square.getTrail().getCurrentLine();
if (i == a)
actualPositive = false;
} else {
vect = trailList.get(b);
}
if ((b == trailList.size() || b == trailList.size() - 1) && i == a)
actualPositive = false;


float intersecting = Intersector.distanceSegmentPoint(vect[0], vect[1], secondSquare.getPosition()); // does the first square trail segment collide w/ second square vector?

if (intersecting < 1) {
Expand Down

0 comments on commit 6865f83

Please sign in to comment.