From 3d3f0107b7b328a9a68159edc7890cc43aa34926 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Mon, 3 Jan 2022 22:32:32 +0100 Subject: move to entity and add player --- src/entity.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/entity.cpp (limited to 'src/entity.cpp') 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(posX) & 1) + { + direction = (Vector2){posX / 100, -posY / 100}; + } else { + direction = (Vector2){-posX / 100, posY / 100}; + } + +} + +Entity::~Entity() {} -- cgit v1.2.3