Commits

Mateo Imbrišak committed f646a6c

playership.h: added x,y getters ; gm_level.cpp: added space event and drawing on that event;

  • Participants
  • Parent commits 087e8fb

Comments (0)

Files changed (3)

 	"bullet.h"
 	"texture.h"
 
-1365866272 f:\pucaljka\bullet.h
+1367074490 f:\pucaljka\bullet.h
 	<SDL/SDL_events.h>
 	<string>
-	"texture.h"
+	"gameobject.h"
 
 1365866086 f:\pucaljka\texture.h
 	<string>
 	<string>
 	"texture.h"
 
-1365866086 f:\pucaljka\gm_level.h
+1367074842 f:\pucaljka\gm_level.h
 	<SDL/SDL.h>
 	<vector>
 	"gamemode.h"
 	"gameobject.h"
 	"enemyship.h"
+	"bullet.h"
 
 1365866086 f:\pucaljka\gamemode.h
 	<SDL/SDL.h>
 1365866086 f:\pucaljka\gameobject.h
 	<SDL/SDL.h>
 
-1365866086 f:\pucaljka\enemyship.h
+1366473868 f:\pucaljka\enemyship.h
 	<SDL/SDL_events.h>
 	<string>
 	"texture.h"
 
-1365866086 source:f:\pucaljka\enemyship.cpp
+1366473868 source:f:\pucaljka\enemyship.cpp
 	"EnemyShip.h"
 	"texture.h"
+	<math.h>
 
 1365866086 source:f:\pucaljka\gamemode.cpp
 	"gamemode.h"
 	<string>
 	"texture.h"
 
-1365866086 f:\pucaljka\playership.h
+1367498698 f:\pucaljka\playership.h
 	<SDL/SDL_events.h>
 	<string>
 	"texture.h"
 
-1365866086 source:f:\pucaljka\gm_mainmenu.cpp
+1366473868 source:f:\pucaljka\gm_mainmenu.cpp
 	"gm_mainmenu.h"
 	<GL/gl.h>
 	<GL/glu.h>
 	"layer.h"
 	"texture.h"
 
-1365866086 source:f:\pucaljka\playership.cpp
+1366473962 source:f:\pucaljka\playership.cpp
 	"playership.h"
 	"texture.h"
 	<SDL/SDL_events.h>
+	"bullet.h"
+	"gm_level.h"
 
-1365866086 source:f:\pucaljka\pucaljka.cpp
+1366473868 source:f:\pucaljka\pucaljka.cpp
 	<stdio.h>
 	<SDL/SDL.h>
 	"gamemode.h"
 	<math.h>
 	"yellowenemyship.h"
 
+1366473868 source:f:\pucaljka\yellowenemyship.cpp
+	<math.h>
+	"yellowenemyship.h"
+
+1366473868 f:\pucaljka\yellowenemyship.h
+	"enemyship.h"
+
 {
     EnemyShip *enemyShip(new EnemyShip("enemyship01.png", 600, 400));
     EnemyShip *blueenemyShip(new EnemyShip("enemyship02.png", 800, 400));
-    Bullet*bullet(new Bullet(150,200));
-    this->bullets.push_back(bullet);
+
 
 
 	this->enemyShips.push_back(enemyShip);
         playership->keyDown(event);
         break;
 
+        case SDLK_SPACE:
+        {
+            const double BX = PlayerShip::getx();
+            const double BY = PlayerShip::gety();
+            Bullet*bullet(new Bullet(BX,BY));
+            this->bullets.push_back(bullet);
+        }
+        break;
+
         default:
         GameMode::keyDown(event);
         break;
 
     void updateSelf(double timeDelta);
 
+    const double getx () { return PlayerShip.x;};
+    const double gety () { return PlayerShip.y;};
 
     private:
     Texture * texture;