Beispiel #1
0
 private void StopAccelerationX()
 {
     accelerationX = 0f;
     state         = (accelerationY == 0)
         ? TaxiBoosterState.TaxiBoosterOff
         : TaxiBoosterState.TaxiBoosterUp;
 }
Beispiel #2
0
 private void StopAccelerationY()
 {
     accelerationY = 0f;
     state         = (accelerationX == 0)
         ? TaxiBoosterState.TaxiBoosterOff
         : TaxiBoosterState.TaxiBoosterHorizontal;
 }
Beispiel #3
0
 private void StartAccelerationY()
 {
     PlayerIsMoving = true;
     accelerationY  = Constants.PLAYER_ACCELERATION_CONST_Y;
     state          = (accelerationX == 0)
         ? TaxiBoosterState.TaxiBoosterUp
         : TaxiBoosterState.TaxiBoosterUpAndHorizontal;
 }
Beispiel #4
0
        public Player()
        {
            orientation = TaxiOrientation.TaxiOrientedLeft;
            state       = TaxiBoosterState.TaxiBoosterOff;

            SpaceTaxiBus.GetBus().Subscribe(GameEventType.PlayerEvent, this);

            Shape = new DynamicShape(new Vec2F(), new Vec2F(0.0625f, 0.045f));

            PlayerIsMoving = true;
        }
Beispiel #5
0
        // get player image
        public IBaseImage GetPlayerImage(TaxiOrientation orientation, TaxiBoosterState state)
        {
            switch (orientation)
            {
            case TaxiOrientation.TaxiOrientedLeft:
                switch (state)
                {
                case TaxiBoosterState.TaxiBoosterOff:
                    return(playerTaxiThrustNone);

                case TaxiBoosterState.TaxiBoosterHorizontal:
                    return(playerTaxiThrustBack);

                case TaxiBoosterState.TaxiBoosterUp:
                    return(playerTaxiThrustBottom);

                case TaxiBoosterState.TaxiBoosterUpAndHorizontal:
                    return(playerTaxiThrustBottomBack);

                default:
                    throw new ArgumentOutOfRangeException(nameof(state), state, null);
                }
                break;

            case TaxiOrientation.TaxiOrientedRight:
                switch (state)
                {
                case TaxiBoosterState.TaxiBoosterOff:
                    return(playerTaxiThrustNoneRight);

                case TaxiBoosterState.TaxiBoosterHorizontal:
                    return(playerTaxiThrustBackRight);

                case TaxiBoosterState.TaxiBoosterUp:
                    return(playerTaxiThrustBottomRight);

                case TaxiBoosterState.TaxiBoosterUpAndHorizontal:
                    return(playerTaxiThrustBottomBackRight);

                default:
                    throw new ArgumentOutOfRangeException(nameof(state), state, null);
                }
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(orientation), orientation, null);
            }
        }
Beispiel #6
0
 private void StartAccelerationX()
 {
     state = (accelerationY == 0)
         ? TaxiBoosterState.TaxiBoosterHorizontal
         : TaxiBoosterState.TaxiBoosterUpAndHorizontal;
 }