Still working on Shooting (shouldn't work yet)
This commit is contained in:
@@ -75,7 +75,20 @@ namespace DepthsBelow
|
|||||||
}
|
}
|
||||||
if (ks.IsKeyDown(Keys.S))
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ namespace DepthsBelow
|
|||||||
|
|
||||||
public List<Shot> Volley;
|
public List<Shot> Volley;
|
||||||
|
|
||||||
private PathFinder.Node nextNode;
|
|
||||||
public Vector2 direction = Vector2.Zero;
|
public Vector2 direction = Vector2.Zero;
|
||||||
|
|
||||||
public Shot(Core core)
|
public Shot(Core core)
|
||||||
|
|||||||
Reference in New Issue
Block a user