]> git.tdb.fi Git - libs/game.git/blobdiff - examples/bassteroids/source/physicalentity.cpp
Implement a simple physics system in Bassteroids
[libs/game.git] / examples / bassteroids / source / physicalentity.cpp
diff --git a/examples/bassteroids/source/physicalentity.cpp b/examples/bassteroids/source/physicalentity.cpp
new file mode 100644 (file)
index 0000000..585eb34
--- /dev/null
@@ -0,0 +1,12 @@
+#include "physicalentity.h"
+#include <msp/game/transform.h>
+
+using namespace Msp;
+
+PhysicalEntity::PhysicalEntity(Game::Handle<Game::Entity> p, const Setup &s):
+       Entity(p, Game::TransformValues()),
+       collider(*this, s.collider)
+{
+       if(!s.fixture)
+               body = Game::Owned<RigidBody>(*this, s.body);
+}