Improvements to Mobile to support smooth movement (like real-ra does it)

- McvDeploy got simpler.
    - BUGFIX: Bullet no longer crashes when it damages a tree
This commit is contained in:
Bob
2009-10-24 17:28:51 +13:00
parent 979bb74bba
commit 06e6d50735
5 changed files with 255 additions and 171 deletions

View File

@@ -23,10 +23,7 @@ namespace OpenRa.Game.Traits
public override IEnumerable<Pair<Sprite, float2>> Render(Actor self)
{
var mobile = self.traits.Get<Mobile>();
float fraction = (mobile.moveFraction > 0) ? (float)mobile.moveFraction / mobile.moveFractionTotal : 0f;
var centerLocation = new float2(12, 12) + Game.CellSize * float2.Lerp(mobile.fromCell, mobile.toCell, fraction);
yield return Centered(anim.Image, centerLocation);
yield return Centered( anim.Image, self.CenterLocation );
}
}
}