diff --git a/Player.cpp b/Player.cpp index b23f8c5..4f2024d 100644 --- a/Player.cpp +++ b/Player.cpp @@ -14,14 +14,14 @@ void Player::move(float dx, float dy) y += dy; } -void Player::rotate(int alpha) +void Player::rotate(float alpha) { - orientation += alpha%360; - if(orientation >= 360) + orientation += fmodf(alpha, 360); + if(orientation > 360) { orientation -= 360; } - if(orientation <= 360) + else if(orientation < 0) { orientation += 360; } diff --git a/Player.h b/Player.h index 05426c5..fd9cf84 100644 --- a/Player.h +++ b/Player.h @@ -17,7 +17,7 @@ public: float fov = 70; void move(float dx, float dy); - void rotate(int alpha); + void rotate(float alpha); };