public override void LoadContent(ContentManager content) { _game = new ChainReactGame(false, true); if (ResourceManager.SoundAvailable) { var sound = ResourceManager.GetResource <Sound>("ExplosionSound"); var effect = new SoundEffect(sound); ResourceManager.ImportResource("ExplosionSoundEffect", effect); } _players = GameSettings.Instance.Players; _gameAreaTexture = ColorTextureConverter.CreateTextureFromColor(64, 64, Color.Gray); var fullWabeSizeX = ChainReactGame.WabeSize * _game.GameMap.Wabes.GetLength(0); var fullWabeSizeY = ChainReactGame.WabeSize * _game.GameMap.Wabes.GetLength(1); var fieldSize = (int)((ChainReactGame.WabeSize) / 3); _wabeBorder = TextureUtilities.CreateBorderFromColor(64, 64, 1, Color.Olive); _gameBorder = TextureUtilities.CreateBorderFromColor((int)fullWabeSizeX, (int)fullWabeSizeY, 3, Color.White); _fieldBorder = TextureUtilities.CreateBorderFromColor(fieldSize, fieldSize, 1, Color.Black); _background = ResourceManager.GetResource <Texture2D>("Background"); _font = ResourceManager.GetResource <SpriteFont>("DefaultFont"); _game.Initialize(_players); }
private void ResetGame() { _players = GameSettings.Instance.Players; _game = new ChainReactGame(false, false); _game.Initialize(_players); }
public override void LoadContent(ContentManager content) { _game = new ChainReactGame(false, true); if (ResourceManager.SoundAvailable) { var sound = ResourceManager.GetResource<Sound>("ExplosionSound"); var effect = new SoundEffect(sound); ResourceManager.ImportResource("ExplosionSoundEffect", effect); } _players = GameSettings.Instance.Players; _gameAreaTexture = ColorTextureConverter.CreateTextureFromColor(64, 64, Color.Gray); var fullWabeSizeX = ChainReactGame.WabeSize * _game.GameMap.Wabes.GetLength(0); var fullWabeSizeY = ChainReactGame.WabeSize * _game.GameMap.Wabes.GetLength(1); var fieldSize = (int)((ChainReactGame.WabeSize) / 3); _wabeBorder = TextureUtilities.CreateBorderFromColor(64, 64, 1, Color.Olive); _gameBorder = TextureUtilities.CreateBorderFromColor((int)fullWabeSizeX, (int)fullWabeSizeY, 3, Color.White); _fieldBorder = TextureUtilities.CreateBorderFromColor(fieldSize, fieldSize, 1, Color.Black); _background = ResourceManager.GetResource<Texture2D>("Background"); _font = ResourceManager.GetResource<SpriteFont>("DefaultFont"); _game.Initialize(_players); }