예제 #1
0
        public void Move(GameObject obj, ShipUpdateInfo info)
        {
            timer.Update(info.gameTime);

            switch (timer.Current)
            {
            case Timer2.TimerNum.First:
                obj.SetRotation(VecUtil.GetNormLeft());
                break;

            case Timer2.TimerNum.Second:
                obj.SetRotation(VecUtil.GetNormRight());
                break;
            }

            obj.SetFaceDir(VecUtil.GetNormDown());
        }
예제 #2
0
        private Vector2 dir;    //left, right, up, or down, in Vector2 form

        public MMCardinal(Cardinal direction)
        {
            switch (direction)
            {
            case Cardinal.Down:
                dir = VecUtil.GetNormDown();
                break;

            case Cardinal.Up:
                dir = VecUtil.GetNormUP();
                break;

            case Cardinal.Left:
                dir = VecUtil.GetNormLeft();
                break;

            case Cardinal.Right:
                dir = VecUtil.GetNormRight();
                break;
            }
        }