From: arvsj277 Date: Thu, 9 Nov 2023 14:42:14 +0000 (+0100) Subject: added header files for Bike_enemy and Autonomous_object X-Git-Url: https://gitweb.forssennils.se/?a=commitdiff_plain;h=c66f32d8e5e704b122c093bc1729b62f3df1455d;p=TDDC76_proj.git added header files for Bike_enemy and Autonomous_object --- diff --git a/src/Autonomous_object.h b/src/Autonomous_object.h index e69de29..ae3bb53 100644 --- a/src/Autonomous_object.h +++ b/src/Autonomous_object.h @@ -0,0 +1,21 @@ +#ifndef AUTONOMOUS_OBJECT_H +#define AUTONOMOUS_OBJECT_H +#include "Object.h" + +class Autonomous_object +{ +public: + virtual bool collides(Object& other) = 0; + virtual void collision(Object& other) = 0; + virtual void update() = 0; + virtual void render(sf::RenderWindow& window) = 0; + + virtual ~Autonomous_object() = default; +private: + virtual void move(Time) = 0; +protected: + double x_pos; + double y_pos; + sf::Sprite sprite; +}; +#endif \ No newline at end of file diff --git a/src/Bike_enemy.h b/src/Bike_enemy.h index e69de29..1120661 100644 --- a/src/Bike_enemy.h +++ b/src/Bike_enemy.h @@ -0,0 +1,25 @@ +#ifndef BIKE_ENEMY_H +#define BIKE_ENEMY_H + +#include "Autonomous_object.h" + +class Bike_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