コード例 #1
0
 public void DegreesToDirection()
 {
     Assert.AreEqual(Direction.UP, GridMath.DegreesToDirection(0));
     Assert.AreEqual(Direction.RIGHT, GridMath.DegreesToDirection(90));
     Assert.AreEqual(Direction.DOWN, GridMath.DegreesToDirection(180));
     Assert.AreEqual(Direction.LEFT, GridMath.DegreesToDirection(270));
 }
コード例 #2
0
ファイル: MimanTing.cs プロジェクト: defc0n1/GameWorld2
        public void TurnDegrees(int pDegrees)
        {
            int degrees = (int)IntPoint.DirectionToIntPoint(direction).Degrees();

            degrees  -= pDegrees;
            direction = GridMath.DegreesToDirection((int)degrees);
        }