]> git.tdb.fi Git - libs/game.git/blobdiff - examples/bassteroids/source/bassteroids.cpp
Begin creating an example game
[libs/game.git] / examples / bassteroids / source / bassteroids.cpp
diff --git a/examples/bassteroids/source/bassteroids.cpp b/examples/bassteroids/source/bassteroids.cpp
new file mode 100644 (file)
index 0000000..2a6d1dd
--- /dev/null
@@ -0,0 +1,21 @@
+#include "bassteroids.h"
+#include <msp/game/root.h>
+#include <msp/game/stage.h>
+#include <msp/game/transform.h>
+#include <msp/game/transformpropagator.h>
+#include "gamecontroller.h"
+#include "physics.h"
+
+using namespace Msp;
+
+Bassteroids::Bassteroids(int, char **):
+       game_stage(director.create_stage()),
+       cam_setup({ .field_of_view_y=Geometry::Angle<float>::zero(), .size={ 80, 45 }, .near_clip=-30, .far_clip=30, .sequence_name="space.seq" }),
+       cam_entity(game_stage.get_root(), Game::TransformValues()),
+       camera(const_cast<const Game::Owned<Game::Entity> &>(cam_entity), cam_setup)
+{
+       game_stage.add_system<GameController>();
+       game_stage.add_system<Game::TransformPropagator>();
+
+       director.activate_stage(game_stage);
+}