diff options
Diffstat (limited to 'examples/statemachine')
-rw-r--r-- | examples/statemachine/errorstateplugins/seek_ai/seek_ai.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/statemachine/errorstateplugins/seek_ai/seek_ai.h b/examples/statemachine/errorstateplugins/seek_ai/seek_ai.h index 7f108a1..83f50a7 100644 --- a/examples/statemachine/errorstateplugins/seek_ai/seek_ai.h +++ b/examples/statemachine/errorstateplugins/seek_ai/seek_ai.h @@ -95,10 +95,10 @@ protected: qreal angleOfWall = m_lastLine.angle(); qreal newDirection; - if (qAbs(currentDirection - angleOfWall) < qAbs(angleOfWall - currentDirection)) + if (qrand() % 2 == 0) newDirection = angleOfWall; else - newDirection = -angleOfWall; + newDirection = angleOfWall - 180.0; m_turnTo->assignProperty(m_tank, "direction", newDirection); } |