Commits

Nikola Cvetko  committed 5e802ca

Added redenemyship.h redenemyship.cpp.

  • Participants
  • Parent commits 97f4bb1

Comments (0)

Files changed (2)

File redenemyship.cpp

+#include <math.h>
+#include "redenemyship.h"
+
+RedEnemyShip::RedEnemyShip(const double x,
+                                 const double y) : EnemyShip("enemyship01.png", x, y), baseY(y)
+{
+}
+
+RedEnemyShip::~RedEnemyShip()
+{
+}
+
+void
+RedEnemyShip::updateSelf(const double timeDelta)
+{
+    this->x-=200*timeDelta;
+    this->y=fabs(x)-150;
+    if(this->y > 0)
+    {
+        y=0;
+    }
+}
+

File redenemyship.h

+#ifndef PUCALJKA_REDENEMYSHIP_H
+#define PUCALJKA_REDENEMYSHIP_H
+
+#include "enemyship.h"
+
+class RedEnemyShip : public EnemyShip
+{
+    public:
+    RedEnemyShip(const double x,
+                    const double y);
+    ~RedEnemyShip();
+
+    void updateSelf(const double timeDelta);
+
+    private:
+    double baseY;
+};
+
+#endif
+