]> git.tdb.fi Git - libs/game.git/blobdiff - examples/bassteroids/source/playercontroller.h
Make it possible to shoot bullets in Bassteroids
[libs/game.git] / examples / bassteroids / source / playercontroller.h
index 83d49f1d715e0edb50ea28041e248984a01ed2c2..d29b2d6218a5fbc9f0a924f3fd9ca06e6167d39c 100644 (file)
@@ -4,6 +4,7 @@
 #include <msp/game/eventobserver.h>
 #include <msp/game/owned.h>
 #include <msp/game/system.h>
+#include "bullet.h"
 #include "ship.h"
 
 class Controls;
@@ -13,7 +14,9 @@ class PlayerController: public Msp::Game::System
 private:
        Controls *controls = nullptr;
        ShipSetup player_setup;
+       BulletSetup bullet_setup;
        Msp::Game::Owned<Ship> player_ship;
+       std::vector<Msp::Game::Owned<Bullet>> bullets;
 
 public:
        PlayerController(Msp::Game::Stage &);
@@ -21,6 +24,8 @@ public:
        void set_controls(Controls *);
 
        void tick(Msp::Time::TimeDelta) override;
+private:
+       void fire();
 };
 
 #endif