private void btnshootaway_Click(object sender, EventArgs e) { //Try again and reopening the application code RouletteGame try1 = new RouletteGame(); try1.try_again(); (new PlayTheRoulette()).Show(); this.Close(); }
private void btnspin_Click(object sender, EventArgs e) { //Spin image and code //image code Image img = Image.FromFile(@"C:\Users\SS077\source\repos\WindowsFormsApp2\Images\spin.gif"); pistol_image.Image = img; //sound code System.Media.SoundPlayer player = new System.Media.SoundPlayer(@"C:\Users\SS077\source\repos\WindowsFormsApp2\Images\spin sound.wav"); player.Play(); RouletteGame SpinObj = new RouletteGame(); Spinval = SpinObj.Spin_Chamber(); btnshoot.Enabled = true; btnspin.Enabled = false; }
private void btnshoot_Click(object sender, EventArgs e) { //Shoot image source and coding //image code Image img = Image.FromFile(@"C:\Users\SS077\source\repos\WindowsFormsApp2\Images\shoot 1.gif"); pistol_image.Image = img; //sound code System.Media.SoundPlayer player = new System.Media.SoundPlayer(@"C:\Users\SS077\source\repos\WindowsFormsApp2\Images\shot.wav"); player.Play(); RouletteGame ShotObj = new RouletteGame(); int score = ShotObj.Fire_Bullet(load, Spinval); if (count == 0 && score == 10) { MessageBox.Show("you won and your score is " + score); btnshoot.Enabled = false; } else if (count == 1 && score == 5) { MessageBox.Show("you won and your score is " + score); btnshoot.Enabled = false; } if (count == 1 && score == 0) { MessageBox.Show("Sorry, you losse the game"); btnshoot.Enabled = false; } else { count++; Spinval = spinchambervalue(Spinval); } }
public void Test_Fire() { RouletteGame testfire = new RouletteGame(); Assert.AreEqual(10, testfire.Fire_Bullet(1, 1)); }