From 2e8be0be6571ab1093a23b1d2173e0b5b762b07c Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Tue, 29 Nov 2011 16:48:23 +0100 Subject: inverted left and right --- AIController.cpp | 2 +- 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); 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; } -- cgit v1.2.3-70-g09d2