コード例 #1
0
        public static ShipMotionState GetMotionState(MotionState state)
        {
            ShipManager pShipMan = ShipManager.PrivInstance();

            Debug.Assert(pShipMan != null);

            ShipMotionState pShipMotionState = null;

            switch (state)
            {
            case ShipManager.MotionState.Free:
                pShipMotionState = pShipMan.pFreeMotionState;
                break;

            case ShipManager.MotionState.LeftOnly:
                pShipMotionState = pShipMan.pLeftMotionOnlyState;
                break;

            case ShipManager.MotionState.RightOnly:
                pShipMotionState = pShipMan.pRightMotionOnlyState;
                break;

            case ShipManager.MotionState.Locked:
                pShipMotionState = pShipMan.pMotionLockedState;
                break;
            }

            return(pShipMotionState);
        }
コード例 #2
0
ファイル: Ship.cs プロジェクト: xNeophyte/Space_Invaders
        public Ship(GameObject.Name name, Sprite.Name spriteName, BoxSprite.Name boxSpriteName, float posX, float posY)
            : base(name, spriteName, boxSpriteName)
        {
            this.x = posX;
            this.y = posY;

            this.speedX       = 5.0f;
            this.pMotionState = null;
            this.pShootState  = null;
        }
コード例 #3
0
ファイル: Ship.cs プロジェクト: xNeophyte/Space_Invaders
 public void SetMotionState(ShipManager.MotionState inState)
 {
     this.pMotionState = ShipManager.GetMotionState(inState);
 }