git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1358 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
(no author)
2007-07-28 01:58:16 +00:00
parent cd70038a3c
commit 812bdeba3f
4 changed files with 87 additions and 5 deletions

View File

@@ -17,6 +17,7 @@ namespace OpenRa.Game
protected TickFunc nextOrder = null;
protected readonly float2 renderOffset;
protected readonly UnitInfo unitInfo;
public Unit( string name, int2 cell, Player owner, float2 renderOffset, Game game )
: base( game )
@@ -24,6 +25,7 @@ namespace OpenRa.Game
fromCell = toCell = cell;
this.renderOffset = renderOffset;
this.owner = owner;
this.unitInfo = Rules.UnitInfo( name );
animation = new Animation( name );
animation.PlayFetchIndex( "idle", delegate { return facing; } );
@@ -53,8 +55,6 @@ namespace OpenRa.Game
return highest;
}
const int Speed = 6;
public override void Tick( Game game, int t )
{
animation.Tick( t );
@@ -78,7 +78,7 @@ namespace OpenRa.Game
if( Turn( GetFacing( toCell - fromCell ) ) )
return;
moveFraction += t * Speed;
moveFraction += t * unitInfo.Speed;
if( moveFraction < moveFractionTotal )
return;