diff --git a/DepthsBelow/DepthsBelow/KeyboardInput.cs b/DepthsBelow/DepthsBelow/KeyboardInput.cs index b3cf368..6d2e15d 100644 --- a/DepthsBelow/DepthsBelow/KeyboardInput.cs +++ b/DepthsBelow/DepthsBelow/KeyboardInput.cs @@ -75,7 +75,20 @@ namespace DepthsBelow } if (ks.IsKeyDown(Keys.S)) { - + foreach (var soldier in core.Squad) + { + core.Volley.Add(new Shot(core)); + foreach (var shot in core.Volley) + { + if (shot.direction == Vector2.Zero) + { + double directionX = Math.Cos(soldier.GetComponent().World.Rotation); + double directionY = Math.Sin(soldier.GetComponent().World.Rotation); + shot.direction = new Vector2((float)directionX, (float)directionY); + + } + } + } } } } diff --git a/DepthsBelow/DepthsBelow/Shot.cs b/DepthsBelow/DepthsBelow/Shot.cs index 46f58af..edd0908 100644 --- a/DepthsBelow/DepthsBelow/Shot.cs +++ b/DepthsBelow/DepthsBelow/Shot.cs @@ -17,7 +17,6 @@ namespace DepthsBelow public List Volley; - private PathFinder.Node nextNode; public Vector2 direction = Vector2.Zero; public Shot(Core core)