Example #1
0
        public void Initialize()
        {
            ActualSelection = new SimPlayerSelection();
            LastSelection = new SimPlayerSelection();
            TurretToBuyController = new SelectedTurretToBuyAllController(AvailableTurrets);
            SelectedCelestialBodyController = new SelectedCelestialBodyController(Simulator, this, CelestialBodies);
            SelectedPowerUpController = new SelectedPowerUpController(Simulator.PowerUpsFactory.Availables, Circle);
            PowerUpInUse = PowerUpType.None;

            MovingLeft = MovingRight = MovingUp = MovingDown = false;
            LastMouseDirection = Vector3.Zero;

            GameOver = false;
            Firing = false;

            if (BasePlayer.InputType == Core.Input.InputType.Mouse)
            {
                SpaceshipMove.SteeringBehavior = new SpaceshipMouseMBehavior(SpaceshipMove);
                PausePlayer.SpaceshipMove.SteeringBehavior = new SpaceshipMouseMBehavior(PausePlayer.SpaceshipMove);
            }
            else if (BasePlayer.InputType == Core.Input.InputType.Gamepad)
            {
                SpaceshipMove.SteeringBehavior = new SpaceshipGamePadMBehavior(SpaceshipMove);
                PausePlayer.SpaceshipMove.SteeringBehavior = new SpaceshipGamePadMBehavior(PausePlayer.SpaceshipMove);
            }
        }
 public void Sync(SimPlayerSelection other)
 {
     celestialBody = other.celestialBody;
     powerUpToBuy = other.powerUpToBuy;
     turret = other.turret;
     turretChoice = other.turretChoice;
     turretToBuy = other.turretToBuy;
     turretToPlace = other.turretToPlace;
     pausedGameChoice = other.pausedGameChoice;
     newGameChoice = other.newGameChoice;
     editingState = other.editingState;
 }