diff --git a/src/entitys/base.cpp b/src/entitys/base.cpp index 8da2fd2..a9fa63d 100644 --- a/src/entitys/base.cpp +++ b/src/entitys/base.cpp @@ -5,10 +5,9 @@ #include #include -Entity::Entity(ID Id, int x, int y, std::string &n, int h, int maxh) { +Entity::Entity(ID Id, raylib::Rectangle Rect, std::string &n, int h, int maxh) { id = Id; - position.x = x; - position.y = y; + rect = Rect; health = h; maxhealth = maxh; nametag = n; @@ -23,5 +22,5 @@ void Entity::Update() { } void Entity::Draw() { - DrawTextureEx(entityTextures.GetTexture(id), position, 0, 0, WHITE); + DrawTextureEx(entityTextures.GetTexture(id), raylib::Vector2(rect.x, rect.y), 0, 0, WHITE); } diff --git a/src/entitys/entitybase.hpp b/src/entitys/entitybase.hpp index 2492b47..bae3a8f 100644 --- a/src/entitys/entitybase.hpp +++ b/src/entitys/entitybase.hpp @@ -14,7 +14,7 @@ using ControllerFunc = std::function; struct Entity { ID id; - raylib::Vector2 position; + raylib::Rectangle rect; int health; int maxhealth; std::string nametag; @@ -22,7 +22,7 @@ struct Entity { void Update(); void Draw(); - Entity(ID Id, int x, int y, std::string &n, int h, int maxh); + Entity(ID Id, raylib::Rectangle rect, std::string &n, int h, int maxh); };