From 545ebb2d67c2c533c921011a58c9a2bcdfa949f2 Mon Sep 17 00:00:00 2001 From: lukel495 Date: Thu, 9 Nov 2023 15:59:52 +0100 Subject: [PATCH] =?utf8?q?skelett=20f=C3=B6r=20Voi=5Fenemy=20och=20liten?= =?utf8?q?=20=C3=A4ndring=20i=20static=5Fobeject.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/Static_object.h | 16 ++++++---------- src/Voi_enemy.h | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/Static_object.h b/src/Static_object.h index ca7994c..0f62fdb 100644 --- a/src/Static_object.h +++ b/src/Static_object.h @@ -7,18 +7,14 @@ class Static_obejct : public Object { public: - { - Static_object() = default; - virtual ~Static_object() = default; - virtual bool collides(Object & other) = 0; - virtual void collision(Object & other) = 0; - virtual void update() = 0; - virtual void render(sf::RenderWindow & window) = 0; - } + Static_object() = default; + virtual ~Static_object() = default; + virtual bool collides(Object &other) = 0; + virtual void collision(Object &other) = 0; + virtual void update() = 0; + virtual void render(sf::RenderWindow &window) = 0; private: - { - } }; #endif \ No newline at end of file diff --git a/src/Voi_enemy.h b/src/Voi_enemy.h index e69de29..bcde053 100644 --- a/src/Voi_enemy.h +++ b/src/Voi_enemy.h @@ -0,0 +1,24 @@ +#ifndef VOI_ENEMY_H +#define VOI_ENEMY_H + +#include +#include "Autonomous_object.h" + +class Voi_enemy +{ +public: + bool collides(Object &other) override; + void collision(Object &other) override; + void update() override; + void render(sf::RenderWindow &window) override; + +private: + void move(Time) override; + +protected: + double x_pos; + double y_pos; + sf::Sprite sprite; +}; + +#endif \ No newline at end of file -- 2.30.2