summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2011-11-29 16:48:23 +0100
committerDominique Martinet <asmadeus@codewreck.org>2011-11-29 16:48:23 +0100
commit2e8be0be6571ab1093a23b1d2173e0b5b762b07c (patch)
treec97aef9d81c2991d8f8ad0e8d6e5cd449736e692
parent01245345c79b815117fd9c1affc37e0bb466d7a0 (diff)
inverted left and right
-rw-r--r--AIController.cpp2
-rw-r--r--Player.cpp4
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);
diff --git a/Player.cpp b/Player.cpp
index e0e2c4e..4ef4603 100644
--- a/Player.cpp
+++ b/Player.cpp
@@ -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;
}