Commits

Mateo Imbrišak  committed ac51463

Added enemyship.cpp and fixed enemyship.h.

  • Participants
  • Parent commits 74b67fd

Comments (0)

Files changed (6)

File EnemyShip.h

-#ifndef PUCALJKA_ENEMYSHIP_H
-#define PUCALJKA_ENEMYSHIP_H
-
-#include <SDL/SDL_events.h>
-#include <string>
-#include "texture.h"
-
-class EnemyShip
-{
-    public:
-    EnemyShip(const std::string& textureFile,
-               const int x,
-               const int y);
-
-
-    virtual ~EnemyShip();
-
-
-    virtual void paintSelf(void)
-    {
-    }
-
-    virtual void updateSelf(const float timeDelta);
-
-    private:
-    Texture*texture;
-    float x,y;
-};
-
-
-
-
-#endif
-

File Pucaljka.cbp

 			<Add library="glu32" />
 			<Add library="SDL_image" />
 		</Linker>
+		<Unit filename="EnemyShip.cpp" />
 		<Unit filename="EnemyShip.h" />
 		<Unit filename="button.cpp" />
 		<Unit filename="button.h" />

File enemyship.cpp

+#include "EnemyShip.h"
+#include "texture.h"
+
+
+EnemyShip::EnemyShip(const std::string& textureFile,
+               const int argX,
+               const int argY) : texture(new Texture(textureFile)), x(argX), y(argY)
+{
+}
+
+EnemyShip::~EnemyShip()
+{
+}
+
+void
+EnemyShip::paintSelf()
+{
+}
+
+void
+EnemyShip::updateSelf(const float timeDelta)
+{
+}
+
+
+
+
+#ifndef PUCALJKA_ENEMYSHIP_H
+#define PUCALJKA_ENEMYSHIP_H
+
+#include <SDL/SDL_events.h>
+#include <string>
+#include "texture.h"
+
+class EnemyShip
+{
+    public:
+    EnemyShip(const std::string& textureFile,
+               const int x,
+               const int y);
+
+
+    virtual ~EnemyShip();
+
+
+    virtual void paintSelf(void);
+
+
+    virtual void updateSelf(const float timeDelta);
+
+    private:
+    Texture*texture;
+    float x,y;
+};
+
+
+
+
+#endif
+

File gm_level.cpp

 
 GM_Level::~GM_Level()
 {
-EnemyShip *EnemyShip(new EnemyShip("enemyship01.png", 600, 400));
+
 }
 
 GM_Level::GM_Level()
 {
-
+    EnemyShip *enemyship(new EnemyShip("enemyship01.png", 600, 400));
+    this->enemyship.push_back(enemyship);
 }
 
 void
-
-
 GM_Level::keyDown(const SDL_Event& event)
 {
     switch(event.key.keysym.sym)
 #include <SDL/SDL.h>
 #include <vector>
 #include "gamemode.h"
+#include "EnemyShip.h"
 
 
 class GM_Level : public GameMode
     void mouseMove(const SDL_Event &event);
 
     private:
+     std::vector <EnemyShip*> enemyship;
 };
 
 #endif