Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 public void SetMotionState(ShipManager.MotionState inState)
 {
     this.pMotionState = ShipManager.GetMotionState(inState);
 }