Still working on Shooting (shouldn't work yet)

This commit is contained in:
Niklas Ulf Anders Cullberg
2012-10-11 13:03:19 +02:00
parent 0a4eafefa3
commit d38e93dc19
2 changed files with 14 additions and 2 deletions
+14 -1
View File
@@ -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<Component.Transform>().World.Rotation);
double directionY = Math.Sin(soldier.GetComponent<Component.Transform>().World.Rotation);
shot.direction = new Vector2((float)directionX, (float)directionY);
}
}
}
}
}
}
-1
View File
@@ -17,7 +17,6 @@ namespace DepthsBelow
public List<Shot> Volley;
private PathFinder.Node nextNode;
public Vector2 direction = Vector2.Zero;
public Shot(Core core)