Commits

Dino Drokan committed c0f2781

Functional LevelBackground.

  • Participants
  • Parent commits 8870f72

Comments (0)

Files changed (4)

 
 }
 
-
-
-
-
+void
+Layer::updateSelf(double timeDelta)
+{
+    // GameObject::updateSelf(timeDelta);
+}
            const int x,
            const int y);
     virtual ~Layer();
-    void paintSelf();
-    
+    virtual void paintSelf();
+    virtual void updateSelf(double timeDelta);
+
     double getX(void) const { return this->x; }
     double getY(void) const { return this->y; }
-    
+
     void setX(double x) { this->x = x; }
     void setY(double y) { this->y = y; }
-    
-    private:
+
+    protected:
     Texture * texture;
     double x, y;
 };

levelbackground.cpp

 
 
 LevelBackground::LevelBackground(const int argX,
-                                 const int argY) : Layer ("lvlbackground1.png", 0,0)
-                       {
-                       }
+                                 const int argY) : Layer ("background.png", 0,0)
+{
+}
 LevelBackground::~LevelBackground()
 {
-    delete this->texture;
 }
 
 void
     glPushMatrix();
     glTranslatef(this->x, this->y, 0);
     glScalef(this->texture->getW(), this->texture->getH(), 0);
+
     glBegin(GL_TRIANGLES);
 
     glTexCoord2f(0, 0);
 void
 LevelBackground::updateSelf(const double timeDelta)
 {
-
+    Layer::updateSelf(timeDelta);
 }

levelbackground.h

     void paintSelf();
     void updateSelf(const double timeDelta);
 
-    private:
-    Texture * texture;
-    float x, y;
-
 };