Пример #1
0
        public PlayingState(Game game)
            : base(game)
        {
            game.Services.AddService(typeof(IPlayingState), this);

            PlayerShip = new Player(OurGame);
            GameThrusterManager = new ThrusterManager(OurGame);

            PlayerShip.GameThrusterManager = GameThrusterManager;

            GameFoodManager = new FoodManager(OurGame);
            PlayerShip.GameFoodManager = GameFoodManager;
            GameFoodManager.PlayerShip = PlayerShip;

            GamePowerupManager = new PowerUpManager(OurGame);
            PlayerShip.GamePowerupManager = GamePowerupManager;
            GamePowerupManager.PlayerShip = PlayerShip;

            OurGame.Components.Add(PlayerShip);
            OurGame.Components.Add(GameThrusterManager);
            OurGame.Components.Add(GameFoodManager);
            OurGame.Components.Add(GamePowerupManager);

            PlayerShip.Enabled = false;
            GameFoodManager.Enabled = false;
            GameThrusterManager.Enabled = false;
            GamePowerupManager.Enabled = false;
            PlayerShip.Visible = false;
            GameFoodManager.Visible = false;
            GameThrusterManager.Visible = false;
            GamePowerupManager.Visible = false;

            soundEffect = Content.Load<SoundEffect>("Music");
            soundEffectIntance = soundEffect.CreateInstance();
        }
Пример #2
0
        public ThrusterParticle(ThrusterManager sm, Vector2 initiallocation, Game game, List<ThrusterParticle> shotlist)
        {
            Location = initiallocation;

            ShotList = shotlist;
            Location = initiallocation;

            GameShotManager = sm;
        }
Пример #3
0
        public void Reset()
        {
            OurGame.Components.Remove(PlayerShip);
            OurGame.Components.Remove(GameThrusterManager);
            OurGame.Components.Remove(GameFoodManager);
            OurGame.Components.Remove(GamePowerupManager);

            int highscore = PlayerShip.HighScore;

            PlayerShip = new Player(OurGame);
            GameThrusterManager = new ThrusterManager(OurGame);

            PlayerShip.GameThrusterManager = GameThrusterManager;

            GameFoodManager = new FoodManager(OurGame);
            PlayerShip.GameFoodManager = GameFoodManager;
            GameFoodManager.PlayerShip = PlayerShip;

            GamePowerupManager = new PowerUpManager(OurGame);
            PlayerShip.GamePowerupManager = GamePowerupManager;
            GamePowerupManager.PlayerShip = PlayerShip;

            OurGame.Components.Add(PlayerShip);
            OurGame.Components.Add(GameThrusterManager);
            OurGame.Components.Add(GameFoodManager);
            OurGame.Components.Add(GamePowerupManager);

            PlayerShip.Enabled = false;
            GameFoodManager.Enabled = false;
            GameThrusterManager.Enabled = false;
            GamePowerupManager.Enabled = false;
            PlayerShip.Visible = false;
            GameFoodManager.Visible = false;
            GameThrusterManager.Visible = false;
            GamePowerupManager.Visible = false;

            PlayerShip.HighScore = highscore;
        }