diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2011-11-29 16:48:23 +0100 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2011-11-29 16:48:23 +0100 |
commit | 2e8be0be6571ab1093a23b1d2173e0b5b762b07c (patch) | |
tree | c97aef9d81c2991d8f8ad0e8d6e5cd449736e692 | |
parent | 01245345c79b815117fd9c1affc37e0bb466d7a0 (diff) |
inverted left and right
-rw-r--r-- | AIController.cpp | 2 | ||||
-rw-r--r-- | Player.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/AIController.cpp b/AIController.cpp index 6d89fd8..b1c781e 100644 --- a/AIController.cpp +++ b/AIController.cpp @@ -39,7 +39,7 @@ void AIController::turnRandom() { if (m_inhibit == 0) { VelocityVector oldVelocity = m_player.getVelocity(); - VelocityVector leftVelocity = VelocityVector(oldVelocity.y, - oldVelocity.x); + VelocityVector leftVelocity = VelocityVector(- oldVelocity.y, oldVelocity.x); // right = -left int sgn_x = leftVelocity.x == 0 ? 0 : (leftVelocity.x > 0 ? 1 : -1); int sgn_y = leftVelocity.y == 0 ? 0 : (leftVelocity.y > 0 ? 1 : -1); @@ -57,13 +57,13 @@ void Player::setVelocity(VelocityVector v) { void Player::turnLeft() {
printf("turnLeft, player %d, velocity: %d, %d\n", m_playerID, m_velocityVector.x, m_velocityVector.y);
- VelocityVector t = VelocityVector(m_velocityVector.y, - m_velocityVector.x);
+ VelocityVector t = VelocityVector(- m_velocityVector.y, m_velocityVector.x);
m_velocityVector = t;
}
void Player::turnRight() {
printf("turnRight, player %d, velocity: %d, %d\n", m_playerID, m_velocityVector.x, m_velocityVector.y);
- VelocityVector t = VelocityVector(- m_velocityVector.y, m_velocityVector.x);
+ VelocityVector t = VelocityVector(m_velocityVector.y, - m_velocityVector.x);
m_velocityVector = t;
}
|