public override void Initialize() { MediaPlayer.Stop(); _menuIndex = 0; _title = (Died) ? "YOU DIED !" : "TIME'S UP !"; // Scores _content.Clear(); _content.Add("Time: " + Math.Round(Time.TotalSeconds, 2).ToString(CultureInfo.InvariantCulture) + " second(s)"); _content.Add("Wave number: " + WaveNumber.ToString(CultureInfo.InvariantCulture)); _content.Add("P1 Score: " + Player1Score.ToString(CultureInfo.InvariantCulture)); if (Config.PlayersNumber == 2) { _content.Add("P2 Score: " + Player2Score.ToString(CultureInfo.InvariantCulture)); } _content.Add("Total Score: " + TotalScore.ToString(CultureInfo.InvariantCulture)); _content.Add("Total credits: " + PlayerData.Credits.ToString(CultureInfo.InvariantCulture)); _actions = new string[] { "Try again", "Back to title screen" }; base.Initialize(); }
void NewWave() { Health health = GameObject.Find("Player").GetComponent <Health>(); WaveNumber wn = GameObject.Find("Wave Number").GetComponent <WaveNumber>(); health.Regen(); wn.ShowWave(wave + 1); beans[0] = gameObject; Invoke("Spawn", 2f); }
private void SelectWave(int index) { _selectedWave = Generator.Waves[index]; _overrideSpawnpointScrollPositions.Clear(); foreach (var cluster in _selectedWave.Wave.WaveClusters) { _overrideSpawnpointScrollPositions.Add(Vector3.zero); } }
private void DeleteWaveAt(int index) { if (ReferenceEquals(_selectedWave, Generator.Waves[index])) { _selectedWave = null; } var wave = Generator.Waves[index]; Generator.Waves.RemoveAt(index); SetDirty(Generator, "Delete wave"); }
private void DrawWaveHeader(int index, WaveNumber waveInfo, float baseY, int totalWaves) { var oldColor = GUI.color; if (!ReferenceEquals(_selectedWave, null) && ReferenceEquals(_selectedWave, waveInfo)) { GUI.color = Color.cyan; } if (GUI.Button(new Rect(Space, baseY + index * 55 + Space, MainButtonWidth, MainButtonHeight), $"Wave {waveInfo.Number}")) { SelectWave(index); } GUI.color = oldColor; if (GUI.Button(new Rect(130, baseY + index * 55 + 6.75f, MiniButtonSize, MiniButtonSize), "+")) { InsertNewWave(index); } if (index > 0) { if (GUI.Button(new Rect(155, baseY + index * 55 + 6.75f, MiniButtonSize, MiniButtonSize), "↑")) { SwapWaves(index, index - 1); } } if (index + 1 < totalWaves) { if (GUI.Button(new Rect(155, baseY + index * 55 + 31.75f, MiniButtonSize, MiniButtonSize), "↓")) { SwapWaves(index, index + 1); } } if (GUI.Button(new Rect(130, baseY + index * 55 + 31.75f, MiniButtonSize, MiniButtonSize), "-")) { DeleteWaveAt(index); } }
//constructor public GameManager(Player player, List <Platform> platforms, List <Platform> leftWalls, List <Platform> rightWalls, GraphicsDevice graphicsDevice, TextureManager textureManager, SoundManager soundManager) { this.player = player; this.platforms = platforms; this.leftWalls = leftWalls; this.rightWalls = rightWalls; isCrouching = false; this.graphicsDevice = graphicsDevice; this.textureManager = textureManager; this.soundManager = soundManager; editedWaves = new List <Wave>(); presetWaves = new List <Wave>(); rangeTexture = textureManager.RangedEnemyTexture; waveNumber = WaveNumber.One; platformVersion = PlatformVersion.Easy; enemyManager = new EnemyManager(graphicsDevice, textureManager); //a boolean representing if the player is on the platform jumping = false; prevGameState = GameState.Menu; }
public void StandardMeasureIndexer_ReciprocalCentiMeter_ReturnsHundredthValue() { var expected = new Measure<WaveNumber>(1.0, WaveNumber.ReciprocalCentiMeter); var actual = new WaveNumber(100.0)[WaveNumber.ReciprocalCentiMeter]; MeasureAssert.MeasuresAreEqual(expected, actual); }
private void GenerateWave() { Generator.GenerateWaves(); _selectedWave = null; }