added header files for Bike_enemy and Autonomous_object
authorarvsj277 <arvsj277@tlvm-4-2-4.ad.liu.se>
Thu, 9 Nov 2023 14:42:14 +0000 (15:42 +0100)
committerarvsj277 <arvsj277@tlvm-4-2-4.ad.liu.se>
Thu, 9 Nov 2023 14:42:14 +0000 (15:42 +0100)
src/Autonomous_object.h
src/Bike_enemy.h

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ae3bb53e31ad16aeeddc12f3dcdd331d55565f6e 100644 (file)
@@ -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
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..112066170c2c0588cc18cc32cbacbb41c4f3c5d4 100644 (file)
@@ -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