start pos

This commit is contained in:
Chris Forbes
2009-12-02 20:49:59 +13:00
parent 7e064fec1a
commit bd5faef639
5 changed files with 32 additions and 23 deletions

View File

@@ -84,5 +84,16 @@ namespace OpenRa.Game.Graphics
{
return (1 / 24.0f) * (new float2(mi.Location.X, mi.Location.Y) + Location);
}
public void GoToStartLocation()
{
var unit = Game.world.Actors
.FirstOrDefault(a => a.Owner == Game.LocalPlayer);
if (unit == null)
return;
scrollPosition = unit.CenterLocation - .5f * new float2(Width, Height);
}
}
}