Пример #1
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;
        }
Пример #2
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();
        }
Пример #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;
        }
Пример #4
0
        public GreenOnion(FoodManager fm, Player playership, Vector2 initiallocation, Vector2 direction, float baserotation, float rotationrate, Game game, List<Food> shotlist)
            : base(fm, playership, initiallocation, direction, baserotation, rotationrate, game, shotlist)
        {
            FoodID = (int)FoodTypes.GreenOnion;

            this.spriteTexture = fm.GreenOnionTexture;
            Scale = 1.0f;
            Orgin = new Vector2(this.spriteTexture.Width / 2, this.spriteTexture.Height / 2);

            this.SpriteTextureData =
    new Color[this.spriteTexture.Width * this.spriteTexture.Height];
            this.spriteTexture.GetData(this.SpriteTextureData);

            soundEffectthree = content.Load<SoundEffect>("Squish");
            soundEffectIntancethree = soundEffectthree.CreateInstance();
        }
Пример #5
0
        public Food(FoodManager fm, Player playership, Vector2 initiallocation, Vector2 direction, float baserotation, float rotationrate, Game game, List<Food> shotlist)
            : base(game)
        {
            Location = initiallocation;
            Direction = direction;

            ShotList = shotlist;
            Location = initiallocation;

            GameFoodManager = fm;

            this.game = game;

            Rotate = baserotation;

            RotationRate = rotationrate;

            PlayerShip = playership;
        }
Пример #6
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;
        }