Lan_Party
BIOS-Overclocker(in)
Hey,
in unserer Klasse habe ich mit ein paar Leuten ein kleines Projekt aufgestellt.
Es soll ein Spiel werden. Das Spiel heißt "Kuhrennen" ist halt ein kleiner Insidergack.
Wir müssen noch die Textboxen durch Bilder ersetzen aber wiesen nicht wie. Dazu könnte man den Code noch verkürzen oder? Dazu soll ein Ton ertönen wenn die erste "Kuh" die die Ziellinie durbrochen ist.
Eine paar Tipps und etwas Hilfe wäre schon sehr nett.
Ein paar verbesserungsvorschläge wären auch toll z.B. was man noch hinzufügen könnte. ^^
BTW: Es wurde alles in C# programmiert.
DL-Link: File-Upload.net - phpQ2TVnr
Code:
in unserer Klasse habe ich mit ein paar Leuten ein kleines Projekt aufgestellt.
Es soll ein Spiel werden. Das Spiel heißt "Kuhrennen" ist halt ein kleiner Insidergack.

Wir müssen noch die Textboxen durch Bilder ersetzen aber wiesen nicht wie. Dazu könnte man den Code noch verkürzen oder? Dazu soll ein Ton ertönen wenn die erste "Kuh" die die Ziellinie durbrochen ist.
Eine paar Tipps und etwas Hilfe wäre schon sehr nett.

Ein paar verbesserungsvorschläge wären auch toll z.B. was man noch hinzufügen könnte. ^^
BTW: Es wurde alles in C# programmiert.
DL-Link: File-Upload.net - phpQ2TVnr
Code:
Kuhrennen
{
publicpartialclassForm2 : Form
{
Int32 iTipp2;
Random rndZufall;
String sKuhname2;
public Form2(Int32 iTipp, String sKuhname)
{
InitializeComponent();
iTipp2 = iTipp;
sKuhname2 = sKuhname;
rndZufall = new System.Random();
}
privatevoid Form2_Load(object sender, EventArgs e)
{
timer1.Start();
}
privatevoid timer1_Tick(object sender, EventArgs e)
{
Int32 iBewegung;
iBewegung = rndZufall.Next(0, 2);
this.label8.Text = Convert.ToString(iTipp2);
//Bewegung Kuh1
if (textBox1.Location.X > 1000)
{
textBox1.Location = newPoint(1000,this.textBox1.Location.Y);
}
this.textBox1.Location = newPoint((this.textBox1.Location.X + iBewegung), this.textBox1.Location.Y);
//Bewegung Kuh2
if (textBox2.Location.X > 1000)
{
textBox2.Location = newPoint(1000, this.textBox2.Location.Y);
}
iBewegung = rndZufall.Next(0, 2);
this.textBox2.Location = newPoint((this.textBox2.Location.X + iBewegung), this.textBox2.Location.Y);
//Bewegung Kuh3
if (textBox3.Location.X > 1000)
{
textBox3.Location = newPoint(1000,this.textBox3.Location.Y);
}
iBewegung = rndZufall.Next(0, 2);
this.textBox3.Location = newPoint((this.textBox3.Location.X + iBewegung), this.textBox3.Location.Y);
//Bewegung Kuh4
if (textBox4.Location.X > 1000)
{
textBox4.Location = newPoint(1000,this.textBox4.Location.Y);
}
iBewegung = rndZufall.Next(0, 2);
this.textBox4.Location = newPoint((this.textBox4.Location.X + iBewegung), this.textBox4.Location.Y);
//Bewegung Kuh5
if (textBox5.Location.X > 1000)
{
textBox5.Location = newPoint(1000,this.textBox5.Location.Y);
}
iBewegung = rndZufall.Next(0, 2);
this.textBox5.Location = newPoint((this.textBox5.Location.X + iBewegung), this.textBox5.Location.Y);
//Bewegung Kuh6
if (textBox6.Location.X > 1000)
{
textBox6.Location = newPoint(1000,this.textBox6.Location.Y);
}
iBewegung = rndZufall.Next(0, 2);
this.textBox6.Location = newPoint((this.textBox6.Location.X + iBewegung), this.textBox6.Location.Y);
if (textBox1.Location.X == 999)
{
MessageBox.Show("Kuh 1 hat gewonnen");
{
publicpartialclassForm2 : Form
{
Int32 iTipp2;
Random rndZufall;
String sKuhname2;
public Form2(Int32 iTipp, String sKuhname)
{
InitializeComponent();
iTipp2 = iTipp;
sKuhname2 = sKuhname;
rndZufall = new System.Random();
}
privatevoid Form2_Load(object sender, EventArgs e)
{
timer1.Start();
}
privatevoid timer1_Tick(object sender, EventArgs e)
{
Int32 iBewegung;
iBewegung = rndZufall.Next(0, 2);
this.label8.Text = Convert.ToString(iTipp2);
//Bewegung Kuh1
if (textBox1.Location.X > 1000)
{
textBox1.Location = newPoint(1000,this.textBox1.Location.Y);
}
this.textBox1.Location = newPoint((this.textBox1.Location.X + iBewegung), this.textBox1.Location.Y);
//Bewegung Kuh2
if (textBox2.Location.X > 1000)
{
textBox2.Location = newPoint(1000, this.textBox2.Location.Y);
}
iBewegung = rndZufall.Next(0, 2);
this.textBox2.Location = newPoint((this.textBox2.Location.X + iBewegung), this.textBox2.Location.Y);
//Bewegung Kuh3
if (textBox3.Location.X > 1000)
{
textBox3.Location = newPoint(1000,this.textBox3.Location.Y);
}
iBewegung = rndZufall.Next(0, 2);
this.textBox3.Location = newPoint((this.textBox3.Location.X + iBewegung), this.textBox3.Location.Y);
//Bewegung Kuh4
if (textBox4.Location.X > 1000)
{
textBox4.Location = newPoint(1000,this.textBox4.Location.Y);
}
iBewegung = rndZufall.Next(0, 2);
this.textBox4.Location = newPoint((this.textBox4.Location.X + iBewegung), this.textBox4.Location.Y);
//Bewegung Kuh5
if (textBox5.Location.X > 1000)
{
textBox5.Location = newPoint(1000,this.textBox5.Location.Y);
}
iBewegung = rndZufall.Next(0, 2);
this.textBox5.Location = newPoint((this.textBox5.Location.X + iBewegung), this.textBox5.Location.Y);
//Bewegung Kuh6
if (textBox6.Location.X > 1000)
{
textBox6.Location = newPoint(1000,this.textBox6.Location.Y);
}
iBewegung = rndZufall.Next(0, 2);
this.textBox6.Location = newPoint((this.textBox6.Location.X + iBewegung), this.textBox6.Location.Y);
if (textBox1.Location.X == 999)
{
MessageBox.Show("Kuh 1 hat gewonnen");

