added shape to Shot, shouldn't need it, but drawing might need it. Well Shot is not used anywhere at the moment
authornireco
Fri, 28 Nov 2008 18:23:57 +0000
changeset 127 241830182118
parent 126 7885c71653d0
child 128 890ac82cdcc0
added shape to Shot, shouldn't need it, but drawing might need it. Well Shot is not used anywhere at the moment
src/proto2/GameState.hh
--- a/src/proto2/GameState.hh	Fri Nov 28 18:19:31 2008 +0000
+++ b/src/proto2/GameState.hh	Fri Nov 28 18:23:57 2008 +0000
@@ -64,7 +64,13 @@
 public:
     Shot(GameState &state, Vector position, bool visible) :
         PhysicsObject((PhysicsWorld &) state, PLAYER_MASS, position, Vector(0, 0)), state(state), visible(visible) {
-
+        // Looks kind of dumb, for ammunition to have shape
+        std::vector<Vector> shape(4);
+        shape[0] = Vector(-1, -1);
+        shape[1] = Vector(-1, 1);
+        shape[2] = Vector(1, 1);
+        shape[3] = Vector(1, -1);
+        setShape(shape);
     }
 private:
     virtual void onCollision();