Beispiel #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();
        }
Beispiel #2
0
        public ShieldUpgrade(PowerUpManager pm, Player playership, Vector2 initiallocation, Game game, List<Upgrade> shotlist)
            : base(pm, playership, initiallocation, game, shotlist)
        {
            UpgradeID = (int)UpgradeTypes.Shield;

            UpgradeTexture = pm.ShieldUpgradeTexture;
        }
Beispiel #3
0
        public Upgrade(PowerUpManager pm, Player playership, Vector2 initiallocation, Game game, List<Upgrade> shotlist)
            : base(game)
        {
            ShotList = shotlist;
            Location = initiallocation;

            GamePowerupManager = pm;

            this.game = game;

            PlayerShip = playership;
        }
Beispiel #4
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;
        }