]> git.tdb.fi Git - libs/game.git/blobdiff - examples/bassteroids/source/playercontroller.h
Add a controllable player ship to Bassteroids
[libs/game.git] / examples / bassteroids / source / playercontroller.h
diff --git a/examples/bassteroids/source/playercontroller.h b/examples/bassteroids/source/playercontroller.h
new file mode 100644 (file)
index 0000000..83d49f1
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef PLAYERCONTROLLER_H_
+#define PLAYERCONTROLLER_H_
+
+#include <msp/game/eventobserver.h>
+#include <msp/game/owned.h>
+#include <msp/game/system.h>
+#include "ship.h"
+
+class Controls;
+
+class PlayerController: public Msp::Game::System
+{
+private:
+       Controls *controls = nullptr;
+       ShipSetup player_setup;
+       Msp::Game::Owned<Ship> player_ship;
+
+public:
+       PlayerController(Msp::Game::Stage &);
+
+       void set_controls(Controls *);
+
+       void tick(Msp::Time::TimeDelta) override;
+};
+
+#endif