Guitar Game

INFORMATION ABOUT GUITAR GAME
Guitar Game is the game which is made in my free time. If you have free time you should not spend it by playing games, you should make your own games, never think about doing something, just do it without thinking. You can never know what kind of experience you can get from a project.
Logic of Guitar Game is same with Guitar Hero. Musical notes are coming one by one and you are pressing right note at the right time to get point.

SOME PICTURES FROM GUITAR GAME




CODES OF GUITAR GAME
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Media;
using System.IO;
namespace Gitar_Oyunu
{
public partial class Form1 : Form
{
SoundPlayer nota1 = new SoundPlayer();
SoundPlayer dat = new SoundPlayer();
int skor;
int cikis;
int zaman;
int baslangic;
public Form1()
{
InitializeComponent();
}

public void timer1_Tick(object sender, EventArgs e)
{
textBox2.Focus();
//pictureBox13.Top = pictureBox13.Top + 1;
int a = sayiuret();

if (a == 1)
{
timer2.Enabled = true;
}
if (a == 2)
{
timer3.Enabled = true;
}
if (a == 3)
{
timer4.Enabled = true;
}
if (a == 4)
{
timer5.Enabled = true;
}
if (a == 5)
{
timer6.Enabled = true;
}
if (a == 6)
{
timer7.Enabled = true;
}



}
private int sayiuret()
{
Random rnd = new Random();
int sayi = rnd.Next(1, 10);
return sayi;
}

private void timer2_Tick(object sender, EventArgs e)
{
pictureBox13.Top = pictureBox13.Top + 4;
}

private void timer3_Tick(object sender, EventArgs e)
{
pictureBox14.Top = pictureBox14.Top + 4;
}

private void timer4_Tick(object sender, EventArgs e)
{
pictureBox15.Top = pictureBox15.Top + 4;
}

private void timer5_Tick(object sender, EventArgs e)
{
pictureBox16.Top = pictureBox16.Top + 4;
}

private void timer6_Tick(object sender, EventArgs e)
{
pictureBox17.Top = pictureBox17.Top + 4;
}

private void timer7_Tick(object sender, EventArgs e)
{
pictureBox18.Top = pictureBox18.Top + 4;
}

public void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
Char temizle = char.Parse("u");

if (e.KeyChar == temizle)
{
textBox2.Text = "";
}
}

private void textBox2_TextChanged(object sender, EventArgs e)
{
if (textBox2.Text == "u")
{
textBox2.Text = "";
}
}

public void timer8_Tick(object sender, EventArgs e)
{
if (textBox2.Text != "1" && pictureBox13.Top > 500 && pictureBox13.Top < 550 ||
textBox2.Text != "2" && pictureBox14.Top > 500 && pictureBox14.Top < 550 ||
textBox2.Text != "3" && pictureBox15.Top > 500 && pictureBox15.Top < 550 ||
textBox2.Text != "4" && pictureBox16.Top > 500 && pictureBox16.Top < 550 ||
textBox2.Text != "5" && pictureBox17.Top > 500 && pictureBox17.Top < 550 ||
textBox2.Text != "6" && pictureBox18.Top > 500 && pictureBox18.Top < 550)
{
label1.Text = Convert.ToString(skor);
skor = skor - 123;
}

#region yenileme
{
if (pictureBox13.Top > 700)
{
pictureBox13.Top = 12;
timer2.Enabled = false;
textBox2.Focus();
}
if (pictureBox14.Top > 700)
{
pictureBox14.Top = 12;
timer3.Enabled = false;
textBox2.Focus();
}
if (pictureBox15.Top > 700)
{
pictureBox15.Top = 12;
timer4.Enabled = false;
textBox2.Focus();
}
if (pictureBox16.Top > 700)
{
pictureBox16.Top = 12;
timer5.Enabled = false;
textBox2.Focus();
}
if (pictureBox17.Top > 700)
{
pictureBox17.Top = 12;
timer6.Enabled = false;
textBox2.Focus();
}
if (pictureBox18.Top > 700)
{
pictureBox18.Top = 12;
timer7.Enabled = false;
textBox2.Focus();
}
if (textBox2.TextLength > 1)
{
textBox2.Clear();
}
}
#endregion
}

private void timer9_Tick(object sender, EventArgs e)
{
if (textBox2.Text == "1" && pictureBox13.Top > 500 && pictureBox13.Top < 550 ||
textBox2.Text == "2" && pictureBox14.Top > 500 && pictureBox14.Top < 550 ||
textBox2.Text == "3" && pictureBox15.Top > 500 && pictureBox15.Top < 550 ||
textBox2.Text == "4" && pictureBox16.Top > 500 && pictureBox16.Top < 550 ||
textBox2.Text == "5" && pictureBox17.Top > 500 && pictureBox17.Top < 550 ||
textBox2.Text == "6" && pictureBox18.Top > 500 && pictureBox18.Top < 550)
{
label1.Text = Convert.ToString(skor);
skor = skor + 123;
}
}

private void timer10_Tick(object sender, EventArgs e)
{
Random deneme = new Random();
int deneme1 = deneme.Next(1, 4);

if (skor < -500 && deneme1 == 1)
{
timer10.Enabled = false;
timer11.Enabled = true;
MessageBox.Show("Loser");
}
if (skor < -500 && deneme1 == 2)
{
timer10.Enabled = false;
timer11.Enabled = true;
MessageBox.Show("Bad");
}
if (skor < -500 && deneme1 == 3)
{
timer10.Enabled = false;
timer11.Enabled = true;
MessageBox.Show("Lame");
}
label4.Text = Convert.ToString(zaman);
if (skor > 1500 && zaman >= 412)
{
timer10.Enabled = false;
timer11.Enabled = true;
MessageBox.Show("Congratulations, You Got " + skor);
FileStream save = new FileStream(@"save.text", FileMode.Append, FileAccess.Write);
StreamWriter yazi = new StreamWriter(save);
yazi.WriteLine(label6.Text + " " + label1.Text);
yazi.Close();
this.Close();

}
if (skor < 1500 && zaman >= 412)
{
timer10.Enabled = false;
timer11.Enabled = true;
MessageBox.Show("You Suck, You Got " + skor);
}
}

private void timer11_Tick(object sender, EventArgs e)
{
label3.Text = Convert.ToString(cikis);
cikis++;
if (cikis == 1)
{
timer1.Enabled = false;
nota1.Stop();
}
}

private void zamant_Tick(object sender, EventArgs e)
{
label4.Text = Convert.ToString(zaman);
zaman++;
}

private void button2_Click(object sender, EventArgs e)
{
timer1.Interval = 2500;
timer12.Enabled = true;
label5.Visible = true;
button2.Visible = false;
button3.Visible = false;
button4.Visible = false;
button5.Visible = false;
timer12.Enabled = true;
label5.Visible = true;
}

private void button3_Click(object sender, EventArgs e)
{
timer1.Interval = 1500;
timer12.Enabled = true;
label5.Visible = true;
button2.Visible = false;
button3.Visible = false;
button4.Visible = false;
button5.Visible = false;
timer12.Enabled = true;
label5.Visible = true;
}

private void button4_Click(object sender, EventArgs e)
{
timer1.Interval = 1000;
timer12.Enabled = true;
label5.Visible = true;
button2.Visible = false;
button3.Visible = false;
button4.Visible = false;
button5.Visible = false;
timer12.Enabled = true;
label5.Visible = true;
}

private void button5_Click(object sender, EventArgs e)
{
timer1.Interval = 750;
timer12.Enabled = true;
label5.Visible = true;
button2.Visible = false;
button3.Visible = false;
button4.Visible = false;
button5.Visible = false;
timer12.Enabled = true;
label5.Visible = true;
}

private void timer12_Tick(object sender, EventArgs e)
{
label5.Text = Convert.ToString(baslangic);
baslangic = baslangic + 1;
if (label5.Text == "4")
{
pictureBox1.Visible = true;
pictureBox2.Visible = true;
pictureBox3.Visible = true;
pictureBox4.Visible = true;
pictureBox5.Visible = true;
pictureBox6.Visible = true;
pictureBox7.Visible = true;
pictureBox8.Visible = true;
pictureBox9.Visible = true;
pictureBox10.Visible = true;
pictureBox11.Visible = true;
pictureBox12.Visible = true;
pictureBox13.Visible = true;
pictureBox14.Visible = true;
pictureBox15.Visible = true;
pictureBox16.Visible = true;
pictureBox17.Visible = true;
pictureBox18.Visible = true;
timer1.Enabled = true;
label5.Visible = false;
label1.Visible = true;
label2.Visible = true;
zamant.Enabled = true;
label6.Visible = true;
nota1.SoundLocation = "1.wav";
nota1.Play();
label7.Visible = true;
}
}

private void button1_Click(object sender, EventArgs e)
{
button2.Visible = true;
button3.Visible = true;
button4.Visible = true;
button5.Visible = true;
button1.Visible = false;
textBox1.Visible = false;
label6.Text = textBox1.Text;
pictureBox19.Visible = false;
button7.Visible = false;
button8.Visible = false;
listBox1.Visible = false;
}

private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.TextLength > 3)
{
button1.Enabled = true;
}
else
{
button1.Enabled = false;
}
}


private void button7_Click(object sender, EventArgs e)
{
textBox1.Visible = false;
button1.Visible = false;
listBox1.Visible = true;
button7.Visible = false;
button8.Visible = true;
FileStream save = new FileStream(@"save.text", FileMode.Open, FileAccess.Read);
StreamReader scor = new StreamReader (save);
string scores = scor.ReadToEnd();
string[] scr = scores.Split(Convert.ToChar(13));

foreach (string veri in scr)
{
listBox1.Items.Add(veri);
}
scor.Close();
}

private void button8_Click(object sender, EventArgs e)
{
listBox1.Visible = false;
button7.Visible = true;
button8.Visible = false;
listBox1.Items.Clear();
textBox1.Visible = true;
button1.Visible = true;
}

}
}