public GameControl(FormGame formGame) { this.formGame = formGame; this.blue = new Botao(); this.blue.IdleColor = Color.Blue; this.blue.ActiveColor = Color.LightBlue; this.blue.InstanceName = "blue"; this.red = new Botao(); this.red.IdleColor = Color.Red; this.red.ActiveColor = Color.LightSalmon; this.red.InstanceName = "red"; this.yellow = new Botao(); this.yellow.IdleColor = Color.Yellow; this.yellow.ActiveColor = Color.LightYellow; this.yellow.InstanceName = "yellow"; this.green = new Botao(); this.green.IdleColor = Color.Green; this.green.ActiveColor = Color.LightGreen; this.green.InstanceName = "green"; this.botoes.Add(this.blue); this.botoes.Add(this.red); this.botoes.Add(this.yellow); this.botoes.Add(this.green); }
private void ExecuteButton(Button FormButton, Botao button, int time) { FormButton.BackColor = button.ActiveColor; this.song.Play(button.SongFilePath); this.Refresh(); Thread.Sleep(interval); this.song.Stop(); FormButton.BackColor = button.IdleColor; this.Refresh(); }
public void CheckSequence(Botao button) { if (this.sequence[this.iteratorSequence] != button) { this.GameOver(); return; } this.iteratorSequence++; if (this.iteratorSequence == this.sequence.Count) { this.score++; this.formGame.UpdateScore(); this.PlaySequence(); } }