diff options
author | Aki <please@ignore.pl> | 2022-11-11 17:20:11 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-11-11 17:20:11 +0100 |
commit | 53d45e11743909b8816ef95f50ac1c2b6467a3b7 (patch) | |
tree | da8f95fd5f127ac2bb09a9662340b9877bb066d5 /kurator | |
parent | bd8b0a9ba1bdd68b915fed75f1e901851b340efd (diff) | |
download | kurator-53d45e11743909b8816ef95f50ac1c2b6467a3b7.zip kurator-53d45e11743909b8816ef95f50ac1c2b6467a3b7.tar.gz kurator-53d45e11743909b8816ef95f50ac1c2b6467a3b7.tar.bz2 |
Changed rotation to be represented by angle
Diffstat (limited to 'kurator')
-rw-r--r-- | kurator/src/Battle.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kurator/src/Battle.cpp b/kurator/src/Battle.cpp index 7320c19..f78675c 100644 --- a/kurator/src/Battle.cpp +++ b/kurator/src/Battle.cpp @@ -1,6 +1,7 @@ #include "Battle.h" #include <algorithm> +#include <cmath> #include <memory> #include <utility> @@ -49,6 +50,7 @@ Battle::draw() const const int x = width/2 + transform.position.x*scale; const int y = height/2 + transform.position.y*scale; DrawCircle(x, y, 5, color); + DrawLine(x, y, x + 6 * std::cos(transform.angle), y + 6 * std::sin(transform.angle), WHITE); DrawText(ship_type.name.c_str(), x+10, y-10, 20.0f, GRAY); } } |