diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-01-03 22:32:32 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-01-03 22:32:32 +0100 |
commit | 3d3f0107b7b328a9a68159edc7890cc43aa34926 (patch) | |
tree | e2d80aeb851803b159a34b7ae85a161b65527b3f /src/entity.cpp | |
parent | balls move yknow (diff) | |
download | threshold-3d3f0107b7b328a9a68159edc7890cc43aa34926.tar.gz threshold-3d3f0107b7b328a9a68159edc7890cc43aa34926.tar.bz2 threshold-3d3f0107b7b328a9a68159edc7890cc43aa34926.tar.xz threshold-3d3f0107b7b328a9a68159edc7890cc43aa34926.tar.zst threshold-3d3f0107b7b328a9a68159edc7890cc43aa34926.zip |
move to entity and add player
Diffstat (limited to 'src/entity.cpp')
-rw-r--r-- | src/entity.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/entity.cpp b/src/entity.cpp new file mode 100644 index 0000000..af93f36 --- /dev/null +++ b/src/entity.cpp @@ -0,0 +1,16 @@ +#include "enemy.hpp" + +Entity::Entity(void) +{ + posX = GetRandomValue(0, SCREENWIDTH); + posY = GetRandomValue(0, SCREENHEIGHT); + if (static_cast<int>(posX) & 1) + { + direction = (Vector2){posX / 100, -posY / 100}; + } else { + direction = (Vector2){-posX / 100, posY / 100}; + } + +} + +Entity::~Entity() {} |