smooth unit-movement. Doesn't look right yet, but it's getting there.

This commit is contained in:
Bob
2009-10-24 18:20:58 +13:00
parent 06e6d50735
commit d66475edcb
3 changed files with 107 additions and 62 deletions

View File

@@ -43,5 +43,15 @@ namespace OpenRa.Game.Traits
return highest * 8;
}
public static int GetNearestFacing( int facing, int desiredFacing )
{
var turn = desiredFacing - facing;
if( turn > 128 )
turn -= 256;
if( turn < -128 )
turn += 256;
return facing + turn;
}
}
}