src/proto2/GameState.hh
changeset 182 84675387ca74
parent 180 bfe1077edab3
child 183 e31ff2152774
--- a/src/proto2/GameState.hh	Wed Dec 03 12:21:38 2008 +0000
+++ b/src/proto2/GameState.hh	Wed Dec 03 14:25:23 2008 +0000
@@ -27,7 +27,8 @@
         shape[2] = Vector(0,9); 
         shape[3] = Vector(-6,0);
         // Initialize the shape of the player (salmiakki shape)
-        setShape(shape);		
+        setShape(shape);
+        collision_elasticity = PLAYER_COLLISION_ELASTICITY;
     }
     
     void debugInfo ();
@@ -42,9 +43,10 @@
     bool visible;
     uint32_t birth_tick;
     uint32_t death_tick;
+    bool target_visible;
 public:
-    Shot(GameState &state, Vector position, bool visible) :
-        PhysicsObject((PhysicsWorld &) state, PLAYER_MASS, position, Vector(0, 0)), state(state), visible(visible) {
+    Shot(GameState &state, Vector position, Vector velocity, bool visible) :
+        PhysicsObject((PhysicsWorld &) state, PLAYER_MASS, position, velocity), state(state), visible(visible) {
         // Looks kind of dumb, for ammunition to have shape
         std::vector<Vector> shape(4);
         shape[0] = Vector(-1, -1);
@@ -52,9 +54,12 @@
         shape[2] = Vector(1, 1);
         shape[3] = Vector(1, -1);
         setShape(shape);
+        target_visible = true;
+        collision_elasticity = 0.9; // = shotType.elasticity
     }
 private:
     virtual void onCollision();
+    virtual void draw(CL_GraphicContext *gc);
 };
 
 class LocalPlayer : public Player {