Thema: Delphi Memory-Spiel: Ideen

Einzelnen Beitrag anzeigen

XardasLP
(Gast)

n/a Beiträge
 
#80

AW: Memory-Spiel: Ideen

  Alt 23. Mär 2016, 19:54
Jop. ^^

Glaube mit dem kann man auch nicht wirklich viel anfangen.

Habe halt alles ohne Klassen programmiert. Aber einmal den richtigen Quellcode, war es nur kopieren/einfügen und Variablen ändern.

Also Delphi_1.jpg: Wenn man auf "Spiel starten" klickt passiert folgendes:

Delphi-Quellcode:
procedure TFormEinstellungen.ButtonStartClick(Sender: TObject);
var
  zahl: integer;
  sl: Tstringlist;
  Kartenposition: integer;
  Position1: integer;
  Position1_1: integer;
  Position2: integer;
  Position2_1: integer;
  Position3: integer;
  Position3_1: integer;
  Position4: integer;
  Position4_1: integer;
  Position5: integer;
  Position5_1: integer;
  Position6: integer;
  Position6_1: integer;
  Position7: integer;
  Position7_1: integer;
  Position8: integer;
  Position8_1: integer;
begin

if (RBE.Checked = False) and (RBM.Checked = False)
then begin showmessage('Wähle bitte einen Spielmodus aus!');
end
else
begin

if (RBZ.Checked = False) and (RBB.Checked = False)
then begin showmessage('Wähle bitte ein Karten- Motiv aus!');
end
else
begin

if (Edit_Timer_UNAUFGEDECKT.Text = '')
then begin showmessage('Bitte wähle die Sekunden aus, nachdem ein falsch gefundenes Kartenpaar verdeckt werden soll!');
end
else
begin
if (RBE.Checked = True) or (RBM.Checked = True) and (RBZ.Checked = True) or
(RBB.Checked = True) and (RBja.Checked = True) or (RBnein.Checked = True)
then begin
FormSpiel.Show;
FormEinstellungen.Visible := False;
FormSpiel.Edit_Einstellung_Timer_LOESCHEN.Text := inttostr(LOESCHEN_JA);
FormSpiel.Timer_LOESCHEN.Interval := strtoint(Edit_Timer_LOESCHEN.Text);
FormSpiel.Timer_UNAUFGEDECKT.Interval := strtoint(Edit_Timer_UNAUFGEDECKT.Text);

randomize;
  sl := tstringlist.Create;
for zahl :=1 to 16 do
  begin
  sl.Insert(random(sl.count),inttostr(zahl));
  end;
Memo_Stringlist.Lines := sl;
Position1 := strtoint(Memo_Stringlist.Lines[0]);
Position1_1 := strtoint(Memo_Stringlist.Lines[1]);
Position2 := strtoint(Memo_Stringlist.Lines[2]);
Position2_1 := strtoint(Memo_Stringlist.Lines[3]);
Position3 := strtoint(Memo_Stringlist.Lines[4]);
Position3_1 := strtoint(Memo_Stringlist.Lines[5]);
Position4 := strtoint(Memo_Stringlist.Lines[6]);
Position4_1 := strtoint(Memo_Stringlist.Lines[7]);
Position5 := strtoint(Memo_Stringlist.Lines[8]);
Position5_1 := strtoint(Memo_Stringlist.Lines[9]);
Position6 := strtoint(Memo_Stringlist.Lines[10]);
Position6_1 := strtoint(Memo_Stringlist.Lines[11]);
Position7 := strtoint(Memo_Stringlist.Lines[12]);
Position7_1 := strtoint(Memo_Stringlist.Lines[13]);
Position8 := strtoint(Memo_Stringlist.Lines[14]);
Position8_1 := strtoint(Memo_Stringlist.Lines[15]);

//__________________________________________________//
//*=====*=====*=====*//Position1//*=====*=====*=====*//

case Position1 of
1: FormSpiel.Image1.Left := 24;
2: FormSpiel.Image1.Left := 160;
3: FormSpiel.Image1.Left := 296;
4: FormSpiel.Image1.Left := 432;
5: FormSpiel.Image1.Left := 24;
6: FormSpiel.Image1.Left := 160;
7: FormSpiel.Image1.Left := 296;
8: FormSpiel.Image1.Left := 432;
9: FormSpiel.Image1.Left := 24;
10: FormSpiel.Image1.Left := 160;
11: FormSpiel.Image1.Left := 296;
12: FormSpiel.Image1.Left := 432;
13: FormSpiel.Image1.Left := 24;
14: FormSpiel.Image1.Left := 160;
15: FormSpiel.Image1.Left := 296;
16: FormSpiel.Image1.Left := 432;
end;

case Position1 of
1: FormSpiel.Image1.Top := 104;
2: FormSpiel.Image1.Top := 104;
3: FormSpiel.Image1.Top := 104;
4: FormSpiel.Image1.Top := 104;
5: FormSpiel.Image1.Top := 240;
6: FormSpiel.Image1.Top := 240;
7: FormSpiel.Image1.Top := 240;
8: FormSpiel.Image1.Top := 240;
9: FormSpiel.Image1.Top := 376;
10: FormSpiel.Image1.Top := 376;
11: FormSpiel.Image1.Top := 376;
12: FormSpiel.Image1.Top := 376;
13: FormSpiel.Image1.Top := 512;
14: FormSpiel.Image1.Top := 512;
15: FormSpiel.Image1.Top := 512;
16: FormSpiel.Image1.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position1_1//*=====*=====*=====*//

case Position1_1 of
1: FormSpiel.Image1_1.Left := 24;
2: FormSpiel.Image1_1.Left := 160;
3: FormSpiel.Image1_1.Left := 296;
4: FormSpiel.Image1_1.Left := 432;
5: FormSpiel.Image1_1.Left := 24;
6: FormSpiel.Image1_1.Left := 160;
7: FormSpiel.Image1_1.Left := 296;
8: FormSpiel.Image1_1.Left := 432;
9: FormSpiel.Image1_1.Left := 24;
10: FormSpiel.Image1_1.Left := 160;
11: FormSpiel.Image1_1.Left := 296;
12: FormSpiel.Image1_1.Left := 432;
13: FormSpiel.Image1_1.Left := 24;
14: FormSpiel.Image1_1.Left := 160;
15: FormSpiel.Image1_1.Left := 296;
16: FormSpiel.Image1_1.Left := 432;
end;

case Position1_1 of
1: FormSpiel.Image1_1.Top := 104;
2: FormSpiel.Image1_1.Top := 104;
3: FormSpiel.Image1_1.Top := 104;
4: FormSpiel.Image1_1.Top := 104;
5: FormSpiel.Image1_1.Top := 240;
6: FormSpiel.Image1_1.Top := 240;
7: FormSpiel.Image1_1.Top := 240;
8: FormSpiel.Image1_1.Top := 240;
9: FormSpiel.Image1_1.Top := 376;
10: FormSpiel.Image1_1.Top := 376;
11: FormSpiel.Image1_1.Top := 376;
12: FormSpiel.Image1_1.Top := 376;
13: FormSpiel.Image1_1.Top := 512;
14: FormSpiel.Image1_1.Top := 512;
15: FormSpiel.Image1_1.Top := 512;
16: FormSpiel.Image1_1.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position2//*=====*=====*=====*//

case Position2 of
1: FormSpiel.Image2.Left := 24;
2: FormSpiel.Image2.Left := 160;
3: FormSpiel.Image2.Left := 296;
4: FormSpiel.Image2.Left := 432;
5: FormSpiel.Image2.Left := 24;
6: FormSpiel.Image2.Left := 160;
7: FormSpiel.Image2.Left := 296;
8: FormSpiel.Image2.Left := 432;
9: FormSpiel.Image2.Left := 24;
10: FormSpiel.Image2.Left := 160;
11: FormSpiel.Image2.Left := 296;
12: FormSpiel.Image2.Left := 432;
13: FormSpiel.Image2.Left := 24;
14: FormSpiel.Image2.Left := 160;
15: FormSpiel.Image2.Left := 296;
16: FormSpiel.Image2.Left := 432;
end;

case Position2 of
1: FormSpiel.Image2.Top := 104;
2: FormSpiel.Image2.Top := 104;
3: FormSpiel.Image2.Top := 104;
4: FormSpiel.Image2.Top := 104;
5: FormSpiel.Image2.Top := 240;
6: FormSpiel.Image2.Top := 240;
7: FormSpiel.Image2.Top := 240;
8: FormSpiel.Image2.Top := 240;
9: FormSpiel.Image2.Top := 376;
10: FormSpiel.Image2.Top := 376;
11: FormSpiel.Image2.Top := 376;
12: FormSpiel.Image2.Top := 376;
13: FormSpiel.Image2.Top := 512;
14: FormSpiel.Image2.Top := 512;
15: FormSpiel.Image2.Top := 512;
16: FormSpiel.Image2.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position2_1//*=====*=====*=====*//

case Position2_1 of
1: FormSpiel.Image2_1.Left := 24;
2: FormSpiel.Image2_1.Left := 160;
3: FormSpiel.Image2_1.Left := 296;
4: FormSpiel.Image2_1.Left := 432;
5: FormSpiel.Image2_1.Left := 24;
6: FormSpiel.Image2_1.Left := 160;
7: FormSpiel.Image2_1.Left := 296;
8: FormSpiel.Image2_1.Left := 432;
9: FormSpiel.Image2_1.Left := 24;
10: FormSpiel.Image2_1.Left := 160;
11: FormSpiel.Image2_1.Left := 296;
12: FormSpiel.Image2_1.Left := 432;
13: FormSpiel.Image2_1.Left := 24;
14: FormSpiel.Image2_1.Left := 160;
15: FormSpiel.Image2_1.Left := 296;
16: FormSpiel.Image2_1.Left := 432;
end;

case Position2_1 of
1: FormSpiel.Image2_1.Top := 104;
2: FormSpiel.Image2_1.Top := 104;
3: FormSpiel.Image2_1.Top := 104;
4: FormSpiel.Image2_1.Top := 104;
5: FormSpiel.Image2_1.Top := 240;
6: FormSpiel.Image2_1.Top := 240;
7: FormSpiel.Image2_1.Top := 240;
8: FormSpiel.Image2_1.Top := 240;
9: FormSpiel.Image2_1.Top := 376;
10: FormSpiel.Image2_1.Top := 376;
11: FormSpiel.Image2_1.Top := 376;
12: FormSpiel.Image2_1.Top := 376;
13: FormSpiel.Image2_1.Top := 512;
14: FormSpiel.Image2_1.Top := 512;
15: FormSpiel.Image2_1.Top := 512;
16: FormSpiel.Image2_1.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position3//*=====*=====*=====*//

case Position3 of
1: FormSpiel.Image3.Left := 24;
2: FormSpiel.Image3.Left := 160;
3: FormSpiel.Image3.Left := 296;
4: FormSpiel.Image3.Left := 432;
5: FormSpiel.Image3.Left := 24;
6: FormSpiel.Image3.Left := 160;
7: FormSpiel.Image3.Left := 296;
8: FormSpiel.Image3.Left := 432;
9: FormSpiel.Image3.Left := 24;
10: FormSpiel.Image3.Left := 160;
11: FormSpiel.Image3.Left := 296;
12: FormSpiel.Image3.Left := 432;
13: FormSpiel.Image3.Left := 24;
14: FormSpiel.Image3.Left := 160;
15: FormSpiel.Image3.Left := 296;
16: FormSpiel.Image3.Left := 432;
end;

case Position3 of
1: FormSpiel.Image3.Top := 104;
2: FormSpiel.Image3.Top := 104;
3: FormSpiel.Image3.Top := 104;
4: FormSpiel.Image3.Top := 104;
5: FormSpiel.Image3.Top := 240;
6: FormSpiel.Image3.Top := 240;
7: FormSpiel.Image3.Top := 240;
8: FormSpiel.Image3.Top := 240;
9: FormSpiel.Image3.Top := 376;
10: FormSpiel.Image3.Top := 376;
11: FormSpiel.Image3.Top := 376;
12: FormSpiel.Image3.Top := 376;
13: FormSpiel.Image3.Top := 512;
14: FormSpiel.Image3.Top := 512;
15: FormSpiel.Image3.Top := 512;
16: FormSpiel.Image3.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position3_1//*=====*=====*=====*//

case Position3_1 of
1: FormSpiel.Image3_1.Left := 24;
2: FormSpiel.Image3_1.Left := 160;
3: FormSpiel.Image3_1.Left := 296;
4: FormSpiel.Image3_1.Left := 432;
5: FormSpiel.Image3_1.Left := 24;
6: FormSpiel.Image3_1.Left := 160;
7: FormSpiel.Image3_1.Left := 296;
8: FormSpiel.Image3_1.Left := 432;
9: FormSpiel.Image3_1.Left := 24;
10: FormSpiel.Image3_1.Left := 160;
11: FormSpiel.Image3_1.Left := 296;
12: FormSpiel.Image3_1.Left := 432;
13: FormSpiel.Image3_1.Left := 24;
14: FormSpiel.Image3_1.Left := 160;
15: FormSpiel.Image3_1.Left := 296;
16: FormSpiel.Image3_1.Left := 432;
end;

case Position3_1 of
1: FormSpiel.Image3_1.Top := 104;
2: FormSpiel.Image3_1.Top := 104;
3: FormSpiel.Image3_1.Top := 104;
4: FormSpiel.Image3_1.Top := 104;
5: FormSpiel.Image3_1.Top := 240;
6: FormSpiel.Image3_1.Top := 240;
7: FormSpiel.Image3_1.Top := 240;
8: FormSpiel.Image3_1.Top := 240;
9: FormSpiel.Image3_1.Top := 376;
10: FormSpiel.Image3_1.Top := 376;
11: FormSpiel.Image3_1.Top := 376;
12: FormSpiel.Image3_1.Top := 376;
13: FormSpiel.Image3_1.Top := 512;
14: FormSpiel.Image3_1.Top := 512;
15: FormSpiel.Image3_1.Top := 512;
16: FormSpiel.Image3_1.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position4//*=====*=====*=====*//

case Position4 of
1: FormSpiel.Image4.Left := 24;
2: FormSpiel.Image4.Left := 160;
3: FormSpiel.Image4.Left := 296;
4: FormSpiel.Image4.Left := 432;
5: FormSpiel.Image4.Left := 24;
6: FormSpiel.Image4.Left := 160;
7: FormSpiel.Image4.Left := 296;
8: FormSpiel.Image4.Left := 432;
9: FormSpiel.Image4.Left := 24;
10: FormSpiel.Image4.Left := 160;
11: FormSpiel.Image4.Left := 296;
12: FormSpiel.Image4.Left := 432;
13: FormSpiel.Image4.Left := 24;
14: FormSpiel.Image4.Left := 160;
15: FormSpiel.Image4.Left := 296;
16: FormSpiel.Image4.Left := 432;
end;

case Position4 of
1: FormSpiel.Image4.Top := 104;
2: FormSpiel.Image4.Top := 104;
3: FormSpiel.Image4.Top := 104;
4: FormSpiel.Image4.Top := 104;
5: FormSpiel.Image4.Top := 240;
6: FormSpiel.Image4.Top := 240;
7: FormSpiel.Image4.Top := 240;
8: FormSpiel.Image4.Top := 240;
9: FormSpiel.Image4.Top := 376;
10: FormSpiel.Image4.Top := 376;
11: FormSpiel.Image4.Top := 376;
12: FormSpiel.Image4.Top := 376;
13: FormSpiel.Image4.Top := 512;
14: FormSpiel.Image4.Top := 512;
15: FormSpiel.Image4.Top := 512;
16: FormSpiel.Image4.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position4_1//*=====*=====*=====*//

case Position4_1 of
1: FormSpiel.Image4_1.Left := 24;
2: FormSpiel.Image4_1.Left := 160;
3: FormSpiel.Image4_1.Left := 296;
4: FormSpiel.Image4_1.Left := 432;
5: FormSpiel.Image4_1.Left := 24;
6: FormSpiel.Image4_1.Left := 160;
7: FormSpiel.Image4_1.Left := 296;
8: FormSpiel.Image4_1.Left := 432;
9: FormSpiel.Image4_1.Left := 24;
10: FormSpiel.Image4_1.Left := 160;
11: FormSpiel.Image4_1.Left := 296;
12: FormSpiel.Image4_1.Left := 432;
13: FormSpiel.Image4_1.Left := 24;
14: FormSpiel.Image4_1.Left := 160;
15: FormSpiel.Image4_1.Left := 296;
16: FormSpiel.Image4_1.Left := 432;
end;

case Position4_1 of
1: FormSpiel.Image4_1.Top := 104;
2: FormSpiel.Image4_1.Top := 104;
3: FormSpiel.Image4_1.Top := 104;
4: FormSpiel.Image4_1.Top := 104;
5: FormSpiel.Image4_1.Top := 240;
6: FormSpiel.Image4_1.Top := 240;
7: FormSpiel.Image4_1.Top := 240;
8: FormSpiel.Image4_1.Top := 240;
9: FormSpiel.Image4_1.Top := 376;
10: FormSpiel.Image4_1.Top := 376;
11: FormSpiel.Image4_1.Top := 376;
12: FormSpiel.Image4_1.Top := 376;
13: FormSpiel.Image4_1.Top := 512;
14: FormSpiel.Image4_1.Top := 512;
15: FormSpiel.Image4_1.Top := 512;
16: FormSpiel.Image4_1.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position5//*=====*=====*=====*//

case Position5 of
1: FormSpiel.Image5.Left := 24;
2: FormSpiel.Image5.Left := 160;
3: FormSpiel.Image5.Left := 296;
4: FormSpiel.Image5.Left := 432;
5: FormSpiel.Image5.Left := 24;
6: FormSpiel.Image5.Left := 160;
7: FormSpiel.Image5.Left := 296;
8: FormSpiel.Image5.Left := 432;
9: FormSpiel.Image5.Left := 24;
10: FormSpiel.Image5.Left := 160;
11: FormSpiel.Image5.Left := 296;
12: FormSpiel.Image5.Left := 432;
13: FormSpiel.Image5.Left := 24;
14: FormSpiel.Image5.Left := 160;
15: FormSpiel.Image5.Left := 296;
16: FormSpiel.Image5.Left := 432;
end;

case Position5 of
1: FormSpiel.Image5.Top := 104;
2: FormSpiel.Image5.Top := 104;
3: FormSpiel.Image5.Top := 104;
4: FormSpiel.Image5.Top := 104;
5: FormSpiel.Image5.Top := 240;
6: FormSpiel.Image5.Top := 240;
7: FormSpiel.Image5.Top := 240;
8: FormSpiel.Image5.Top := 240;
9: FormSpiel.Image5.Top := 376;
10: FormSpiel.Image5.Top := 376;
11: FormSpiel.Image5.Top := 376;
12: FormSpiel.Image5.Top := 376;
13: FormSpiel.Image5.Top := 512;
14: FormSpiel.Image5.Top := 512;
15: FormSpiel.Image5.Top := 512;
16: FormSpiel.Image5.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position5_1//*=====*=====*=====*//

case Position5_1 of
1: FormSpiel.Image5_1.Left := 24;
2: FormSpiel.Image5_1.Left := 160;
3: FormSpiel.Image5_1.Left := 296;
4: FormSpiel.Image5_1.Left := 432;
5: FormSpiel.Image5_1.Left := 24;
6: FormSpiel.Image5_1.Left := 160;
7: FormSpiel.Image5_1.Left := 296;
8: FormSpiel.Image5_1.Left := 432;
9: FormSpiel.Image5_1.Left := 24;
10: FormSpiel.Image5_1.Left := 160;
11: FormSpiel.Image5_1.Left := 296;
12: FormSpiel.Image5_1.Left := 432;
13: FormSpiel.Image5_1.Left := 24;
14: FormSpiel.Image5_1.Left := 160;
15: FormSpiel.Image5_1.Left := 296;
16: FormSpiel.Image5_1.Left := 432;
end;

case Position5_1 of
1: FormSpiel.Image5_1.Top := 104;
2: FormSpiel.Image5_1.Top := 104;
3: FormSpiel.Image5_1.Top := 104;
4: FormSpiel.Image5_1.Top := 104;
5: FormSpiel.Image5_1.Top := 240;
6: FormSpiel.Image5_1.Top := 240;
7: FormSpiel.Image5_1.Top := 240;
8: FormSpiel.Image5_1.Top := 240;
9: FormSpiel.Image5_1.Top := 376;
10: FormSpiel.Image5_1.Top := 376;
11: FormSpiel.Image5_1.Top := 376;
12: FormSpiel.Image5_1.Top := 376;
13: FormSpiel.Image5_1.Top := 512;
14: FormSpiel.Image5_1.Top := 512;
15: FormSpiel.Image5_1.Top := 512;
16: FormSpiel.Image5_1.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position6//*=====*=====*=====*//

case Position6 of
1: FormSpiel.Image6.Left := 24;
2: FormSpiel.Image6.Left := 160;
3: FormSpiel.Image6.Left := 296;
4: FormSpiel.Image6.Left := 432;
5: FormSpiel.Image6.Left := 24;
6: FormSpiel.Image6.Left := 160;
7: FormSpiel.Image6.Left := 296;
8: FormSpiel.Image6.Left := 432;
9: FormSpiel.Image6.Left := 24;
10: FormSpiel.Image6.Left := 160;
11: FormSpiel.Image6.Left := 296;
12: FormSpiel.Image6.Left := 432;
13: FormSpiel.Image6.Left := 24;
14: FormSpiel.Image6.Left := 160;
15: FormSpiel.Image6.Left := 296;
16: FormSpiel.Image6.Left := 432;
end;

case Position6 of
1: FormSpiel.Image6.Top := 104;
2: FormSpiel.Image6.Top := 104;
3: FormSpiel.Image6.Top := 104;
4: FormSpiel.Image6.Top := 104;
5: FormSpiel.Image6.Top := 240;
6: FormSpiel.Image6.Top := 240;
7: FormSpiel.Image6.Top := 240;
8: FormSpiel.Image6.Top := 240;
9: FormSpiel.Image6.Top := 376;
10: FormSpiel.Image6.Top := 376;
11: FormSpiel.Image6.Top := 376;
12: FormSpiel.Image6.Top := 376;
13: FormSpiel.Image6.Top := 512;
14: FormSpiel.Image6.Top := 512;
15: FormSpiel.Image6.Top := 512;
16: FormSpiel.Image6.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position6_1//*=====*=====*=====*//

case Position6_1 of
1: FormSpiel.Image6_1.Left := 24;
2: FormSpiel.Image6_1.Left := 160;
3: FormSpiel.Image6_1.Left := 296;
4: FormSpiel.Image6_1.Left := 432;
5: FormSpiel.Image6_1.Left := 24;
6: FormSpiel.Image6_1.Left := 160;
7: FormSpiel.Image6_1.Left := 296;
8: FormSpiel.Image6_1.Left := 432;
9: FormSpiel.Image6_1.Left := 24;
10: FormSpiel.Image6_1.Left := 160;
11: FormSpiel.Image6_1.Left := 296;
12: FormSpiel.Image6_1.Left := 432;
13: FormSpiel.Image6_1.Left := 24;
14: FormSpiel.Image6_1.Left := 160;
15: FormSpiel.Image6_1.Left := 296;
16: FormSpiel.Image6_1.Left := 432;
end;

case Position6_1 of
1: FormSpiel.Image6_1.Top := 104;
2: FormSpiel.Image6_1.Top := 104;
3: FormSpiel.Image6_1.Top := 104;
4: FormSpiel.Image6_1.Top := 104;
5: FormSpiel.Image6_1.Top := 240;
6: FormSpiel.Image6_1.Top := 240;
7: FormSpiel.Image6_1.Top := 240;
8: FormSpiel.Image6_1.Top := 240;
9: FormSpiel.Image6_1.Top := 376;
10: FormSpiel.Image6_1.Top := 376;
11: FormSpiel.Image6_1.Top := 376;
12: FormSpiel.Image6_1.Top := 376;
13: FormSpiel.Image6_1.Top := 512;
14: FormSpiel.Image6_1.Top := 512;
15: FormSpiel.Image6_1.Top := 512;
16: FormSpiel.Image6_1.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position7//*=====*=====*=====*//

case Position7 of
1: FormSpiel.Image7.Left := 24;
2: FormSpiel.Image7.Left := 160;
3: FormSpiel.Image7.Left := 296;
4: FormSpiel.Image7.Left := 432;
5: FormSpiel.Image7.Left := 24;
6: FormSpiel.Image7.Left := 160;
7: FormSpiel.Image7.Left := 296;
8: FormSpiel.Image7.Left := 432;
9: FormSpiel.Image7.Left := 24;
10: FormSpiel.Image7.Left := 160;
11: FormSpiel.Image7.Left := 296;
12: FormSpiel.Image7.Left := 432;
13: FormSpiel.Image7.Left := 24;
14: FormSpiel.Image7.Left := 160;
15: FormSpiel.Image7.Left := 296;
16: FormSpiel.Image7.Left := 432;
end;

case Position7 of
1: FormSpiel.Image7.Top := 104;
2: FormSpiel.Image7.Top := 104;
3: FormSpiel.Image7.Top := 104;
4: FormSpiel.Image7.Top := 104;
5: FormSpiel.Image7.Top := 240;
6: FormSpiel.Image7.Top := 240;
7: FormSpiel.Image7.Top := 240;
8: FormSpiel.Image7.Top := 240;
9: FormSpiel.Image7.Top := 376;
10: FormSpiel.Image7.Top := 376;
11: FormSpiel.Image7.Top := 376;
12: FormSpiel.Image7.Top := 376;
13: FormSpiel.Image7.Top := 512;
14: FormSpiel.Image7.Top := 512;
15: FormSpiel.Image7.Top := 512;
16: FormSpiel.Image7.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position6_1//*=====*=====*=====*//

case Position7_1 of
1: FormSpiel.Image7_1.Left := 24;
2: FormSpiel.Image7_1.Left := 160;
3: FormSpiel.Image7_1.Left := 296;
4: FormSpiel.Image7_1.Left := 432;
5: FormSpiel.Image7_1.Left := 24;
6: FormSpiel.Image7_1.Left := 160;
7: FormSpiel.Image7_1.Left := 296;
8: FormSpiel.Image7_1.Left := 432;
9: FormSpiel.Image7_1.Left := 24;
10: FormSpiel.Image7_1.Left := 160;
11: FormSpiel.Image7_1.Left := 296;
12: FormSpiel.Image7_1.Left := 432;
13: FormSpiel.Image7_1.Left := 24;
14: FormSpiel.Image7_1.Left := 160;
15: FormSpiel.Image7_1.Left := 296;
16: FormSpiel.Image7_1.Left := 432;
end;

case Position7_1 of
1: FormSpiel.Image7_1.Top := 104;
2: FormSpiel.Image7_1.Top := 104;
3: FormSpiel.Image7_1.Top := 104;
4: FormSpiel.Image7_1.Top := 104;
5: FormSpiel.Image7_1.Top := 240;
6: FormSpiel.Image7_1.Top := 240;
7: FormSpiel.Image7_1.Top := 240;
8: FormSpiel.Image7_1.Top := 240;
9: FormSpiel.Image7_1.Top := 376;
10: FormSpiel.Image7_1.Top := 376;
11: FormSpiel.Image7_1.Top := 376;
12: FormSpiel.Image7_1.Top := 376;
13: FormSpiel.Image7_1.Top := 512;
14: FormSpiel.Image7_1.Top := 512;
15: FormSpiel.Image7_1.Top := 512;
16: FormSpiel.Image7_1.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position8//*=====*=====*=====*//

case Position8 of
1: FormSpiel.Image8.Left := 24;
2: FormSpiel.Image8.Left := 160;
3: FormSpiel.Image8.Left := 296;
4: FormSpiel.Image8.Left := 432;
5: FormSpiel.Image8.Left := 24;
6: FormSpiel.Image8.Left := 160;
7: FormSpiel.Image8.Left := 296;
8: FormSpiel.Image8.Left := 432;
9: FormSpiel.Image8.Left := 24;
10: FormSpiel.Image8.Left := 160;
11: FormSpiel.Image8.Left := 296;
12: FormSpiel.Image8.Left := 432;
13: FormSpiel.Image8.Left := 24;
14: FormSpiel.Image8.Left := 160;
15: FormSpiel.Image8.Left := 296;
16: FormSpiel.Image8.Left := 432;
end;

case Position8 of
1: FormSpiel.Image8.Top := 104;
2: FormSpiel.Image8.Top := 104;
3: FormSpiel.Image8.Top := 104;
4: FormSpiel.Image8.Top := 104;
5: FormSpiel.Image8.Top := 240;
6: FormSpiel.Image8.Top := 240;
7: FormSpiel.Image8.Top := 240;
8: FormSpiel.Image8.Top := 240;
9: FormSpiel.Image8.Top := 376;
10: FormSpiel.Image8.Top := 376;
11: FormSpiel.Image8.Top := 376;
12: FormSpiel.Image8.Top := 376;
13: FormSpiel.Image8.Top := 512;
14: FormSpiel.Image8.Top := 512;
15: FormSpiel.Image8.Top := 512;
16: FormSpiel.Image8.Top := 512;
end;


//__________________________________________________//
//*=====*=====*=====*//Position8_1//*=====*=====*=====*//

case Position8_1 of
1: FormSpiel.Image8_1.Left := 24;
2: FormSpiel.Image8_1.Left := 160;
3: FormSpiel.Image8_1.Left := 296;
4: FormSpiel.Image8_1.Left := 432;
5: FormSpiel.Image8_1.Left := 24;
6: FormSpiel.Image8_1.Left := 160;
7: FormSpiel.Image8_1.Left := 296;
8: FormSpiel.Image8_1.Left := 432;
9: FormSpiel.Image8_1.Left := 24;
10: FormSpiel.Image8_1.Left := 160;
11: FormSpiel.Image8_1.Left := 296;
12: FormSpiel.Image8_1.Left := 432;
13: FormSpiel.Image8_1.Left := 24;
14: FormSpiel.Image8_1.Left := 160;
15: FormSpiel.Image8_1.Left := 296;
16: FormSpiel.Image8_1.Left := 432;
end;

case Position8_1 of
1: FormSpiel.Image8_1.Top := 104;
2: FormSpiel.Image8_1.Top := 104;
3: FormSpiel.Image8_1.Top := 104;
4: FormSpiel.Image8_1.Top := 104;
5: FormSpiel.Image8_1.Top := 240;
6: FormSpiel.Image8_1.Top := 240;
7: FormSpiel.Image8_1.Top := 240;
8: FormSpiel.Image8_1.Top := 240;
9: FormSpiel.Image8_1.Top := 376;
10: FormSpiel.Image8_1.Top := 376;
11: FormSpiel.Image8_1.Top := 376;
12: FormSpiel.Image8_1.Top := 376;
13: FormSpiel.Image8_1.Top := 512;
14: FormSpiel.Image8_1.Top := 512;
15: FormSpiel.Image8_1.Top := 512;
16: FormSpiel.Image8_1.Top := 512;
end
end
end
end
end

end;
Es wird also festgelegt (zufällig) an welchen Plätzen die Paare verteilt werden.

Man gelangt dann zu dieser Form (Delphi_2.jpg)

Dort spielt man bis alle Karten aufgedeckt sind.
Ich zeige euch mal den Quellcode für Karte1 und die drei Timer jeweils nur angeschnitten.

Kopf der Form:
Delphi-Quellcode:
unit USpiel;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, jpeg, StdCtrls, ComCtrls, CommCtrl;

type
  TFormSpiel = class(TForm)
    Timer_FALSCH: TTimer;
    Timer_UNAUFGEDECKT: TTimer;
    Timer_LOESCHEN: TTimer;
    Panel_Spielfeld: TPanel;
    Image1: TImage;
    Image1_1: TImage;
    Image2: TImage;
    Image2_1: TImage;
    Image4_1: TImage;
    Image4: TImage;
    Image3_1: TImage;
    Image3: TImage;
    Image5: TImage;
    Image5_1: TImage;
    Image6: TImage;
    Image6_1: TImage;
    Image8_1: TImage;
    Image8: TImage;
    Image7_1: TImage;
    Image7: TImage;
    Label_Information: TLabel;
    Image9: TImage;
    Label3: TLabel;
    Label4: TLabel;
    Image10: TImage;
    Panel14: TPanel;
    Panel16: TPanel;
    Panel17: TPanel;
    Panel18: TPanel;
    Panel19: TPanel;
    Panel21: TPanel;
    Panel22: TPanel;
    Panel23: TPanel;
    Panel24: TPanel;
    Panel25: TPanel;
    Panel26: TPanel;
    GroupBox1: TGroupBox;
    Label5: TLabel;
    Label6: TLabel;
    Label_Paare_Gefunden: TLabel;
    Label_PKZ_1: TLabel;
    Label_PKZ_2: TLabel;
    ProgressBar_Spielfortschritt: TProgressBar;
    Panel9: TPanel;
    Panel12: TPanel;
    Panel13: TPanel;
    Panel20: TPanel;
    Panel1: TPanel;
    Edit_Einstellung_Timer_LOESCHEN: TEdit;
    Button1: TButton;
    procedure Image1Click(Sender: TObject);
    procedure Image1_1Click(Sender: TObject);
    procedure Image2Click(Sender: TObject);
    procedure Image2_1Click(Sender: TObject);
    procedure Image3Click(Sender: TObject);
    procedure Image3_1Click(Sender: TObject);
    procedure Image4Click(Sender: TObject);
    procedure Image4_1Click(Sender: TObject);
    procedure Image5Click(Sender: TObject);
    procedure Image5_1Click(Sender: TObject);
    procedure Image6Click(Sender: TObject);
    procedure Image6_1Click(Sender: TObject);
    procedure Image7Click(Sender: TObject);
    procedure Image7_1Click(Sender: TObject);
    procedure Image8Click(Sender: TObject);
    procedure Image8_1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Timer_FALSCHTimer(Sender: TObject);
    procedure Timer_UNAUFGEDECKTTimer(Sender: TObject);
    procedure Timer_LOESCHENTimer(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormSpiel: TFormSpiel;
  B1, B1_1: integer; // Bild 1 GEFUNDEN, Bild 1_1 GEFUNDEN
  B2, B2_1: integer; // Bild 2 GEFUNDEN, Bild 2_1 GEFUNDEN
  B3, B3_1: integer; // Bild 3 GEFUNDEN, Bild 3_1 GEFUNDEN
  B4, B4_1: integer; // Bild 4 GEFUNDEN, Bild 4_1 GEFUNDEN
  B5, B5_1: integer; // Bild 5 GEFUNDEN, Bild 5_1 GEFUNDEN
  B6, B6_1: integer; // Bild 6 GEFUNDEN, Bild 6_1 GEFUNDEN
  B7, B7_1: integer; // Bild 7 GEFUNDEN, Bild 7_1 GEFUNDEN
  B8, B8_1: integer; // Bild 8 GEFUNDEN, Bild 8_1 GEFUNDEN
  anz1, anz1_1: integer; // Bild 1 Anzahl, Bild 1_1 Anzahl
  anz2, anz2_1: integer; // Bild 2 Anzahl, Bild 2_1 Anzahl
  anz3, anz3_1: integer; // Bild 3 Anzahl, Bild 3_1 Anzahl
  anz4, anz4_1: integer; // Bild 4 Anzahl, Bild 4_1 Anzahl
  anz5, anz5_1: integer; // Bild 5 Anzahl, Bild 5_1 Anzahl
  anz6, anz6_1: integer; // Bild 6 Anzahl, Bild 6_1 Anzahl
  anz7, anz7_1: integer; // Bild 7 Anzahl, Bild 7_1 Anzahl
  anz8, anz8_1: integer; // Bild 8 Anzahl, Bild 8_1 Anzahl
  erg: integer; // Ergebnis der addierten Anzahlen
  Spielende: integer; //Wenn alle 8 Paare gefunden wurden, also 16 Punkte erreicht sind
  Paar1: integer; // Bild 1 und Bild 1_1 sind gefunden = 2 Punkte
  Paar2: integer; // Bild 2 und Bild 2_1 sind gefunden = 2 Punkte
  Paar3: integer; // Bild 3 und Bild 3_1 sind gefunden = 2 Punkte
  Paar4: integer; // Bild 4 und Bild 4_1 sind gefunden = 2 Punkte
  Paar5: integer; // Bild 5 und Bild 5_1 sind gefunden = 2 Punkte
  Paar6: integer; // Bild 6 und Bild 6_1 sind gefunden = 2 Punkte
  Paar7: integer; // Bild 7 und Bild 7_1 sind gefunden = 2 Punkte
  Paar8: integer; // Bild 8 und Bild 8_1 sind gefunden = 2 Punkte
  Paarsumme: integer; //Summe aus Paar1 ... Paar8
  Paar1GELOESCHT: integer; //Karte 1 und Karte 1_1 wurden aufgedeckt und zerstört
  Paar2GELOESCHT: integer; //Karte 2 und Karte 2_1 wurden aufgedeckt und zerstört
  Paar3GELOESCHT: integer; //Karte 3 und Karte 3_1 wurden aufgedeckt und zerstört
  Paar4GELOESCHT: integer; //Karte 4 und Karte 4_1 wurden aufgedeckt und zerstört
  Paar5GELOESCHT: integer; //Karte 5 und Karte 5_1 wurden aufgedeckt und zerstört
  Paar6GELOESCHT: integer; //Karte 6 und Karte 6_1 wurden aufgedeckt und zerstört
  Paar7GELOESCHT: integer; //Karte 7 und Karte 7_1 wurden aufgedeckt und zerstört
  Paar8GELOESCHT: integer; //Karte 8 und Karte 8_1 wurden aufgedeckt und zerstört
  ErsterZug : integer;
  ZweiterZug : integer;
implementation

uses UGewonnen;

{$R *.dfm}
Karte1:
Delphi-Quellcode:
procedure TFormSpiel.Image1Click(Sender: TObject);
begin{1}

  if (erg > 1) then
    begin{2}
      erg := 0;
      anz1 := 0;
      anz1_1 := 0;
      anz2 := 0;
      anz2_1 := 0;
      anz3 := 0;
      anz3_1 := 0;
      anz4 := 0;
      anz4_1 := 0;
      anz5 := 0;
      anz5_1 := 0;
      anz6 := 0;
      anz6_1 := 0;
      anz7 := 0;
      anz7_1 := 0;
      anz8 := 0;
      anz8_1 := 0;
    end{2}

    else
      begin{3}
        anz1 := 1;
        erg := anz1 + anz1_1 + anz2 + anz2_1 + anz3 + anz3_1 + anz4 + anz4_1 + anz5 + anz5_1 + anz6 + anz6_1 + anz7 + anz7_1 + anz8 + anz8_1;

          if (erg = 1) then
            begin{4}
              Image1.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_1.jpg');
              Image9.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_1.jpg');
              B1 := 1;
              ErsterZug := 1;
              Label_Information.Caption := 'Sie haben Karte 1 aufgedeckt!';
              Spielende := Spielende+1;
                        if Spielende <=9 then Label_PKZ_1.Caption := inttostr(Spielende) + ' von 16';
                        if Spielende >10 then Label_PKZ_2.Visible := True;
                        if Spielende >10 then Label_PKZ_2.Caption := inttostr(Spielende);
                        ProgressBar_Spielfortschritt.Position := Spielende;
                          if (Spielende >=4) and (Spielende <= 8) then
                        SendMessage(ProgressBar_Spielfortschritt.Handle, PBM_SETBARCOLOR, 0, $000090FF);
                         if (Spielende >=8) and (Spielende <= 12) then
                        SendMessage(ProgressBar_Spielfortschritt.Handle, PBM_SETBARCOLOR, 0, clYellow);
                        if (Spielende >=12) and (Spielende < 16) then
                        SendMessage(ProgressBar_Spielfortschritt.Handle, PBM_SETBARCOLOR, 0, clGreen);

                        if Paar1GELOESCHT = 0 then
                        Image1.Enabled := False;

            end{4}

              else
                if (erg = 2) then
                  begin{5}
                    Image1.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_1.jpg');
                    Image10.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_1.jpg');
                    B1 := 1;
                      if (B1 = 1) and (B1_1 = 1) then
                      begin{6}
                        Label_Information.Caption := 'Sie haben Paar 1 gefunden! Super :)';
                        Image1.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_1A.jpg');
                        Image1_1.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_1A.jpg');
                        Image9.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_1A.jpg');
                        Image10.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_1A.jpg');
                        Timer_LOESCHEN.Enabled := True;
                        Paar1 := 1;
                        Paarsumme := Paar1 + Paar2 + Paar3 + Paar4 + Paar5 + Paar6 + Paar7 + Paar8;
                        Label_Paare_Gefunden.Caption := inttostr(Paarsumme) + ' / 8';

                        if Paar1GELOESCHT = 0 then
                        Image1.Enabled := False;

                        if Paar1GELOESCHT = 0 then
                        Image1_1.Enabled := False;

                        if Paar2GELOESCHT = 0 then
                        Image2.Enabled := False;

                        if Paar2GELOESCHT = 0 then
                        Image2_1.Enabled := False;

                        if Paar3GELOESCHT = 0 then
                        Image3.Enabled := False;

                        if Paar3GELOESCHT = 0 then
                        Image3_1.Enabled := False;

                        if Paar4GELOESCHT = 0 then
                        Image4.Enabled := False;

                        if Paar4GELOESCHT = 0 then
                        Image4_1.Enabled := False;

                        if Paar5GELOESCHT = 0 then
                        Image5.Enabled := False;

                        if Paar5GELOESCHT = 0 then
                        Image5_1.Enabled := False;

                        if Paar6GELOESCHT = 0 then
                        Image6.Enabled := False;

                        if Paar6GELOESCHT = 0 then
                        Image6_1.Enabled := False;

                        if Paar7GELOESCHT = 0 then
                        Image7.Enabled := False;

                        if Paar7GELOESCHT = 0 then
                        Image7_1.Enabled := False;

                        if Paar8GELOESCHT = 0 then
                        Image8.Enabled := False;

                        if Paar8GELOESCHT = 0 then
                        Image8_1.Enabled := False;

                        Spielende := Spielende+1;
                        if Spielende <=9 then Label_PKZ_1.Caption := inttostr(Spielende) + ' von 16';
                        if Spielende >10 then Label_PKZ_2.Visible := True;
                        if Spielende >10 then Label_PKZ_2.Caption := inttostr(Spielende);
                        ProgressBar_Spielfortschritt.Position := Spielende;
                          if (Spielende >=4) and (Spielende <= 8) then
                        SendMessage(ProgressBar_Spielfortschritt.Handle, PBM_SETBARCOLOR, 0, $000090FF);
                         if (Spielende >=8) and (Spielende <= 12) then
                        SendMessage(ProgressBar_Spielfortschritt.Handle, PBM_SETBARCOLOR, 0, clYellow);
                        if (Spielende >=12) and (Spielende < 16) then
                        SendMessage(ProgressBar_Spielfortschritt.Handle, PBM_SETBARCOLOR, 0, clGreen);
                        if (Spielende = 16) then begin
                        showmessage('Sie haben das Spiel gewonnen! Herzlichen Glückwunsch :)');
                        SendMessage(ProgressBar_Spielfortschritt.Handle, PBM_SETBARCOLOR, 0, clLime);
                        FormGewonnen.Show;
                        FormSpiel.Close;
                        end
                      end{6}

                        else
                        begin
                           Label_Information.Caption := 'Leider passen diese Karten nicht zusammen! :(';
                           Timer_FALSCH.Enabled := True;
                           ZweiterZug := 1;

                        Spielende := Spielende-1;
                        if Spielende <=9 then Label_PKZ_1.Caption := inttostr(Spielende) + ' von 16';
                        if Spielende >10 then Label_PKZ_2.Visible := True;
                        if Spielende >10 then Label_PKZ_2.Caption := inttostr(Spielende);
                        ProgressBar_Spielfortschritt.Position := Spielende;
                          if (Spielende >=4) and (Spielende <= 8) then
                        SendMessage(ProgressBar_Spielfortschritt.Handle, PBM_SETBARCOLOR, 0, $000090FF);
                         if (Spielende >=8) and (Spielende <= 12) then
                        SendMessage(ProgressBar_Spielfortschritt.Handle, PBM_SETBARCOLOR, 0, clYellow);
                        if (Spielende >=12) and (Spielende < 16) then
                        SendMessage(ProgressBar_Spielfortschritt.Handle, PBM_SETBARCOLOR, 0, clGreen);

                       if Paar1GELOESCHT = 0 then
                        Image1.Enabled := False;

                        if Paar1GELOESCHT = 0 then
                        Image1_1.Enabled := False;

                        if Paar2GELOESCHT = 0 then
                        Image2.Enabled := False;

                        if Paar2GELOESCHT = 0 then
                        Image2_1.Enabled := False;

                        if Paar3GELOESCHT = 0 then
                        Image3.Enabled := False;

                        if Paar3GELOESCHT = 0 then
                        Image3_1.Enabled := False;

                        if Paar4GELOESCHT = 0 then
                        Image4.Enabled := False;

                        if Paar4GELOESCHT = 0 then
                        Image4_1.Enabled := False;

                        if Paar5GELOESCHT = 0 then
                        Image5.Enabled := False;

                        if Paar5GELOESCHT = 0 then
                        Image5_1.Enabled := False;

                        if Paar6GELOESCHT = 0 then
                        Image6.Enabled := False;

                        if Paar6GELOESCHT = 0 then
                        Image6_1.Enabled := False;

                        if Paar7GELOESCHT = 0 then
                        Image7.Enabled := False;

                        if Paar7GELOESCHT = 0 then
                        Image7_1.Enabled := False;

                        if Paar8GELOESCHT = 0 then
                        Image8.Enabled := False;

                        if Paar8GELOESCHT = 0 then
                        Image8_1.Enabled := False;


      end{3}
                  end{5}  end


end;{1}
Timer_FALSCH (sorgt für rote Anzeige der Karten):
Delphi-Quellcode:
procedure TFormSpiel.Timer_FALSCHTimer(Sender: TObject);
begin

//*=====*=====*=====*//Karte 1 und Karte 2//*=====*=====*=====*/
if (B1 = 1) and (B2 = 2) then
begin
Image1.Picture.LoadFromFile('\Spielkarten\Spielkarte_1F.jpg');
Image2.Picture.LoadFromFile('\Spielkarten\Spielkarte_2F.jpg');

if (ErsterZug = 1) or (ErsterZug = 11) then
Image9.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_1F.jpg');

if (ZweiterZug = 1) or (ZweiterZug = 11) then
Image10.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_1F.jpg');

if (ErsterZug = 2) or (ErsterZug = 21) then
Image9.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_2F.jpg');

if (ZweiterZug = 2) or (ZweiterZug = 21) then
Image10.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_2F.jpg');

Timer_FALSCH.Enabled := False;
Timer_UNAUFGEDECKT.Enabled := True;
end


//*=====*=====*=====*//Karte 1 und Karte 2_1//*=====*=====*=====*//
else
begin
if (B1 = 1) and (B2_1 = 2) then
begin
Image1.Picture.LoadFromFile('\Spielkarten\Spielkarte_1F.jpg');
Image2_1.Picture.LoadFromFile('\Spielkarten\Spielkarte_2F.jpg');

if (ErsterZug = 1) or (ErsterZug = 11) then
Image9.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_1F.jpg');

if (ZweiterZug = 1) or (ZweiterZug = 11) then
Image10.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_1F.jpg');

if (ErsterZug = 2) or (ErsterZug = 21) then
Image9.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_2F.jpg');

if (ZweiterZug = 2) or (ZweiterZug = 21) then
Image10.Picture.LoadFromFile('\MEMORY\Spielkarten\Spielkarte_2F.jpg');

Timer_FALSCH.Enabled := False;
Timer_UNAUFGEDECKT.Enabled := True;
end
...usw. sind 16*8 Möglichkeiten

Danach wird Timer_UNAUFGEDECKT ausgeführt:
Delphi-Quellcode:
procedure TFormSpiel.Timer_UNAUFGEDECKTTimer(Sender: TObject);
begin

Timer_UNAUFGEDECKT.Enabled := False;

if Paar1GELOESCHT = 0 then
Image1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar1GELOESCHT = 0 then
Image1_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar1GELOESCHT = 0 then
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar1GELOESCHT = 0 then
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar1GELOESCHT = 0 then
Image1.Enabled := True;
if Paar1GELOESCHT = 0 then
Image1_1.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar2GELOESCHT = 0 then
Image2_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar2GELOESCHT = 0 then
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar2GELOESCHT = 0 then
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar2GELOESCHT = 0 then
Image2.Enabled := True;
if Paar2GELOESCHT = 0 then
Image2_1.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar3GELOESCHT = 0 then
Image3_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar3GELOESCHT = 0 then
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar3GELOESCHT = 0 then
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar3GELOESCHT = 0 then
Image3.Enabled := True;
if Paar3GELOESCHT = 0 then
Image3_1.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar4GELOESCHT = 0 then
Image4_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar4GELOESCHT = 0 then
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar4GELOESCHT = 0 then
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar4GELOESCHT = 0 then
Image4.Enabled := True;
if Paar4GELOESCHT = 0 then
Image4_1.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar5GELOESCHT = 0 then
Image5_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar5GELOESCHT = 0 then
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar5GELOESCHT = 0 then
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar5GELOESCHT = 0 then
Image5.Enabled := True;
if Paar5GELOESCHT = 0 then
Image5_1.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar6GELOESCHT = 0 then
Image6_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar6GELOESCHT = 0 then
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar6GELOESCHT = 0 then
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar6GELOESCHT = 0 then
Image6.Enabled := True;
if Paar6GELOESCHT = 0 then
Image6_1.Enabled := True;

if Paar7GELOESCHT = 0 then begin
Image7.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar7GELOESCHT = 0 then
Image7_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar7GELOESCHT = 0 then
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar7GELOESCHT = 0 then
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar7GELOESCHT = 0 then
Image7.Enabled := True;
if Paar7GELOESCHT = 0 then
Image7_1.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar8GELOESCHT = 0 then
Image8_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar8GELOESCHT = 0 then
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar8GELOESCHT = 0 then
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
if Paar8GELOESCHT = 0 then
Image8.Enabled := True;
if Paar8GELOESCHT = 0 then
Image8_1.Enabled := True;

Timer_UNAUFGEDECKT.Enabled := False;
ErsterZug := 0;
ZweiterZug := 0;
anz1 := 0;
anz1_1 := 0;
anz2 := 0;
anz2_1 := 0;
anz3 := 0;
anz3_1 := 0;
anz4 := 0;
anz4_1 := 0;
anz5 := 0;
anz5_1 := 0;
anz6 := 0;
anz6_1 := 0;
anz7 := 0;
anz7_1 := 0;
anz8 := 0;
anz8_1 := 0;
B1 := 0;
B1_1 := 0;
B2 := 0;
B2_1 := 0;
B3 := 0;
B3_1 := 0;
B4 := 0;
B4_1 := 0;
B5 := 0;
B5_1 := 0;
B6 := 0;
B6_1 := 0;
B7 := 0;
B7_1 := 0;
B8 := 0;
B8_1 := 0;
erg := 0;

end
end;
Dieser dreht alle Karten um außer diese, welche ausgeschlossen werden.

Wenn 2 Karten richtig sind setzt dieser Timer_LOESCHEN ein:
Delphi-Quellcode:
procedure TFormSpiel.Timer_LOESCHENTimer(Sender: TObject);
begin

if (B1 = 1) and (B1_1 = 1) then
begin
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image1.Visible := False;
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image1_1.Visible := False;
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Paar1GELOESCHT := 1;
B1 := 0;
B1_1 := 0;
B2 := 0;
B2_1 := 0;
B3 := 0;
B3_1 := 0;
B4 := 0;
B4_1 := 0;
B5 := 0;
B5_1 := 0;
B6 := 0;
B6_1 := 0;
B7 := 0;
B7_1 := 0;
B8 := 0;
B8_1 := 0;
anz1 := 0;
anz1_1 := 0;
anz2 := 0;
anz2_1 := 0;
anz3 := 0;
anz3_1 := 0;
anz4 := 0;
anz4_1 := 0;
anz5 := 0;
anz5_1 := 0;
anz6 := 0;
anz6_1 := 0;
anz7 := 0;
anz7_1 := 0;
anz8 := 0;
anz8_1 := 0;
erg := 0;
ErsterZug := 0;
ZweiterZug := 0;
if Paar1GELOESCHT = 0 then
Image1.Enabled := True;

if Paar1GELOESCHT = 0 then
Image1_1.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2_1.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3_1.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4_1.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5_1.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6_1.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7_1.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8_1.Enabled := True;

Timer_LOESCHEN.Enabled := False;
end
else
begin

if (B2 = 2) and (B2_1 = 2) then
begin
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image2.Visible := False;
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image2_1.Visible := False;
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Paar2GELOESCHT := 1;
B1 := 0;
B1_1 := 0;
B2 := 0;
B2_1 := 0;
B3 := 0;
B3_1 := 0;
B4 := 0;
B4_1 := 0;
B5 := 0;
B5_1 := 0;
B6 := 0;
B6_1 := 0;
B7 := 0;
B7_1 := 0;
B8 := 0;
B8_1 := 0;
anz1 := 0;
anz1_1 := 0;
anz2 := 0;
anz2_1 := 0;
anz3 := 0;
anz3_1 := 0;
anz4 := 0;
anz4_1 := 0;
anz5 := 0;
anz5_1 := 0;
anz6 := 0;
anz6_1 := 0;
anz7 := 0;
anz7_1 := 0;
anz8 := 0;
anz8_1 := 0;
erg := 0;
ErsterZug := 0;
ZweiterZug := 0;
if Paar1GELOESCHT = 0 then
Image1.Enabled := True;

if Paar1GELOESCHT = 0 then
Image1_1.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2_1.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3_1.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4_1.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5_1.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6_1.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7_1.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8_1.Enabled := True;
Timer_LOESCHEN.Enabled := False;
end
else
begin

if (B3 = 3) and (B3_1 = 3) then
begin
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image3.Visible := False;
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image3_1.Visible := False;
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Paar3GELOESCHT := 1;
B1 := 0;
B1_1 := 0;
B2 := 0;
B2_1 := 0;
B3 := 0;
B3_1 := 0;
B4 := 0;
B4_1 := 0;
B5 := 0;
B5_1 := 0;
B6 := 0;
B6_1 := 0;
B7 := 0;
B7_1 := 0;
B8 := 0;
B8_1 := 0;
anz1 := 0;
anz1_1 := 0;
anz2 := 0;
anz2_1 := 0;
anz3 := 0;
anz3_1 := 0;
anz4 := 0;
anz4_1 := 0;
anz5 := 0;
anz5_1 := 0;
anz6 := 0;
anz6_1 := 0;
anz7 := 0;
anz7_1 := 0;
anz8 := 0;
anz8_1 := 0;
erg := 0;
ErsterZug := 0;
ZweiterZug := 0;
if Paar1GELOESCHT = 0 then
Image1.Enabled := True;

if Paar1GELOESCHT = 0 then
Image1_1.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2_1.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3_1.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4_1.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5_1.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6_1.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7_1.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8_1.Enabled := True;
Timer_LOESCHEN.Enabled := False;
end
else
begin

if (B4 = 4) and (B4_1 = 4) then
begin
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image4.Visible := False;
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image4_1.Visible := False;
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Paar4GELOESCHT := 1;
B1 := 0;
B1_1 := 0;
B2 := 0;
B2_1 := 0;
B3 := 0;
B3_1 := 0;
B4 := 0;
B4_1 := 0;
B5 := 0;
B5_1 := 0;
B6 := 0;
B6_1 := 0;
B7 := 0;
B7_1 := 0;
B8 := 0;
B8_1 := 0;
anz1 := 0;
anz1_1 := 0;
anz2 := 0;
anz2_1 := 0;
anz3 := 0;
anz3_1 := 0;
anz4 := 0;
anz4_1 := 0;
anz5 := 0;
anz5_1 := 0;
anz6 := 0;
anz6_1 := 0;
anz7 := 0;
anz7_1 := 0;
anz8 := 0;
anz8_1 := 0;
erg := 0;
ErsterZug := 0;
ZweiterZug := 0;
if Paar1GELOESCHT = 0 then
Image1.Enabled := True;

if Paar1GELOESCHT = 0 then
Image1_1.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2_1.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3_1.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4_1.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5_1.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6_1.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7_1.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8_1.Enabled := True;
Timer_LOESCHEN.Enabled := False;
end
else
begin

if (B5 = 5) and (B5_1 = 5) then
begin
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image5.Visible := False;
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image5_1.Visible := False;
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Paar5GELOESCHT := 1;
B1 := 0;
B1_1 := 0;
B2 := 0;
B2_1 := 0;
B3 := 0;
B3_1 := 0;
B4 := 0;
B4_1 := 0;
B5 := 0;
B5_1 := 0;
B6 := 0;
B6_1 := 0;
B7 := 0;
B7_1 := 0;
B8 := 0;
B8_1 := 0;
anz1 := 0;
anz1_1 := 0;
anz2 := 0;
anz2_1 := 0;
anz3 := 0;
anz3_1 := 0;
anz4 := 0;
anz4_1 := 0;
anz5 := 0;
anz5_1 := 0;
anz6 := 0;
anz6_1 := 0;
anz7 := 0;
anz7_1 := 0;
anz8 := 0;
anz8_1 := 0;
erg := 0;
ErsterZug := 0;
ZweiterZug := 0;
if Paar1GELOESCHT = 0 then
Image1.Enabled := True;

if Paar1GELOESCHT = 0 then
Image1_1.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2_1.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3_1.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4_1.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5_1.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6_1.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7_1.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8_1.Enabled := True;
Timer_LOESCHEN.Enabled := False;
end
else
begin

if (B6 = 6) and (B6_1 = 6) then
begin
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image6.Visible := False;
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image6_1.Visible := False;
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Paar6GELOESCHT := 1;
B1 := 0;
B1_1 := 0;
B2 := 0;
B2_1 := 0;
B3 := 0;
B3_1 := 0;
B4 := 0;
B4_1 := 0;
B5 := 0;
B5_1 := 0;
B6 := 0;
B6_1 := 0;
B7 := 0;
B7_1 := 0;
B8 := 0;
B8_1 := 0;
anz1 := 0;
anz1_1 := 0;
anz2 := 0;
anz2_1 := 0;
anz3 := 0;
anz3_1 := 0;
anz4 := 0;
anz4_1 := 0;
anz5 := 0;
anz5_1 := 0;
anz6 := 0;
anz6_1 := 0;
anz7 := 0;
anz7_1 := 0;
anz8 := 0;
anz8_1 := 0;
erg := 0;
ErsterZug := 0;
ZweiterZug := 0;
if Paar1GELOESCHT = 0 then
Image1.Enabled := True;

if Paar1GELOESCHT = 0 then
Image1_1.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2_1.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3_1.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4_1.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5_1.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6_1.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7_1.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8_1.Enabled := True;
end
else
begin

if (B7 = 7) and (B7_1 = 7) then
begin
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image7.Visible := False;
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image7_1.Visible := False;
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Timer_LOESCHEN.Enabled := False;
Paar7GELOESCHT := 1;
B1 := 0;
B1_1 := 0;
B2 := 0;
B2_1 := 0;
B3 := 0;
B3_1 := 0;
B4 := 0;
B4_1 := 0;
B5 := 0;
B5_1 := 0;
B6 := 0;
B6_1 := 0;
B7 := 0;
B7_1 := 0;
B8 := 0;
B8_1 := 0;
anz1 := 0;
anz1_1 := 0;
anz2 := 0;
anz2_1 := 0;
anz3 := 0;
anz3_1 := 0;
anz4 := 0;
anz4_1 := 0;
anz5 := 0;
anz5_1 := 0;
anz6 := 0;
anz6_1 := 0;
anz7 := 0;
anz7_1 := 0;
anz8 := 0;
anz8_1 := 0;
erg := 0;
ErsterZug := 0;
ZweiterZug := 0;
if Paar1GELOESCHT = 0 then
Image1.Enabled := True;

if Paar1GELOESCHT = 0 then
Image1_1.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2_1.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3_1.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4_1.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5_1.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6_1.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7_1.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8_1.Enabled := True;
end
else
begin

if (B8 = 8) and (B8_1 = 8) then
begin
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image8.Visible := False;
if (Edit_Einstellung_Timer_LOESCHEN.Text = '1') then
Image8_1.Visible := False;
Image9.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Image10.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
Timer_LOESCHEN.Enabled := False;
Paar8GELOESCHT := 1;
B1 := 0;
B1_1 := 0;
B2 := 0;
B2_1 := 0;
B3 := 0;
B3_1 := 0;
B4 := 0;
B4_1 := 0;
B5 := 0;
B5_1 := 0;
B6 := 0;
B6_1 := 0;
B7 := 0;
B7_1 := 0;
B8 := 0;
B8_1 := 0;
anz1 := 0;
anz1_1 := 0;
anz2 := 0;
anz2_1 := 0;
anz3 := 0;
anz3_1 := 0;
anz4 := 0;
anz4_1 := 0;
anz5 := 0;
anz5_1 := 0;
anz6 := 0;
anz6_1 := 0;
anz7 := 0;
anz7_1 := 0;
anz8 := 0;
anz8_1 := 0;
erg := 0;
ErsterZug := 0;
ZweiterZug := 0;
if Paar1GELOESCHT = 0 then
Image1.Enabled := True;

if Paar1GELOESCHT = 0 then
Image1_1.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2.Enabled := True;

if Paar2GELOESCHT = 0 then
Image2_1.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3.Enabled := True;

if Paar3GELOESCHT = 0 then
Image3_1.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4.Enabled := True;

if Paar4GELOESCHT = 0 then
Image4_1.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5.Enabled := True;

if Paar5GELOESCHT = 0 then
Image5_1.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6.Enabled := True;

if Paar6GELOESCHT = 0 then
Image6_1.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7.Enabled := True;

if Paar7GELOESCHT = 0 then
Image7_1.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8.Enabled := True;

if Paar8GELOESCHT = 0 then
Image8_1.Enabled := True;
Timer_LOESCHEN.Enabled := False;
end
end
end
end
end
end
end
end
end;
Sobald alle 8 Paare gefunden worden, ist das Spiel gewonnen und er wechsel zur FormGewonnen (Delphi_3.jpg) und macht dabei FormSpiel.Close;

Nun sagt mir bitte, wie ich die FormSpiel zurücksetzen kann?

Der Button "Neues Spiel" soll dann alles zurücksetzen und man kommt wieder in die Spieleinstellungen (Delphi_1.jpg).

Delphi-Quellcode:
procedure TFormGEWONNEN.ImageNEUES_SPIELClick(Sender: TObject);
begin
FormEinstellungen.Show;
FormGewonnen.Close;

FormSpiel.Image1.Free;
FormSpiel.Image1_1.Free;
FormSpiel.Image2.Free;
FormSpiel.Image2_1.Free;
FormSpiel.Image3.Free;
FormSpiel.Image3_1.Free;
FormSpiel.Image4.Free;
FormSpiel.Image4_1.Free;
FormSpiel.Image5.Free;
FormSpiel.Image5_1.Free;
FormSpiel.Image6.Free;
FormSpiel.Image6_1.Free;
FormSpiel.Image7.Free;
FormSpiel.Image7_1.Free;
FormSpiel.Image8.Free;
FormSpiel.Image8_1.Free;

FormSpiel.Image1 := FormSpiel.Image1.Create(FormSpiel);
FormSpiel.Image1_1 := FormSpiel.Image1_1.Create(FormSpiel);

FormSpiel.Image2 := FormSpiel.Image1.Create(FormSpiel);
FormSpiel.Image2_1 := FormSpiel.Image1_1.Create(FormSpiel);

FormSpiel.Image3 := FormSpiel.Image1.Create(FormSpiel);
FormSpiel.Image3_1 := FormSpiel.Image1_1.Create(FormSpiel);

FormSpiel.Image4 := FormSpiel.Image1.Create(FormSpiel);
FormSpiel.Image4_1 := FormSpiel.Image1_1.Create(FormSpiel);

FormSpiel.Image5 := FormSpiel.Image1.Create(FormSpiel);
FormSpiel.Image5_1 := FormSpiel.Image1_1.Create(FormSpiel);

FormSpiel.Image6 := FormSpiel.Image1.Create(FormSpiel);
FormSpiel.Image6_1 := FormSpiel.Image1_1.Create(FormSpiel);

FormSpiel.Image7 := FormSpiel.Image1.Create(FormSpiel);
FormSpiel.Image7_1 := FormSpiel.Image1_1.Create(FormSpiel);

FormSpiel.Image8 := FormSpiel.Image1.Create(FormSpiel);
FormSpiel.Image8_1 := FormSpiel.Image1_1.Create(FormSpiel);

FormSpiel.Image1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image1_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image2.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image2_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image3.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image3_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image4.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image4_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image5.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image5_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image6.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image6_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image7.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image7_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image8.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Image8_1.Picture.LoadFromFile('\Spielkarten\Rueckseite.jpg');
FormSpiel.Label_Information.Caption := '';
FormSpiel.ProgressBar_Spielfortschritt.Position := 0;
FormSpiel.Label_Paare_Gefunden.Caption := '0 / 8';
FormSpiel.Label_PKZ_1.Caption := '0 von 16';
FormSpiel.Label_PKZ_2.Caption := '';
FormSpiel.Image1.Enabled := True;
FormSpiel.Image1_1.Enabled := True;
FormSpiel.Image2.Enabled := True;
FormSpiel.Image2_1.Enabled := True;
FormSpiel.Image3.Enabled := True;
FormSpiel.Image3_1.Enabled := True;
FormSpiel.Image4.Enabled := True;
FormSpiel.Image4_1.Enabled := True;
FormSpiel.Image5.Enabled := True;
FormSpiel.Image5_1.Enabled := True;
FormSpiel.Image6.Enabled := True;
FormSpiel.Image6_1.Enabled := True;
FormSpiel.Image7.Enabled := True;
FormSpiel.Image7_1.Enabled := True;
FormSpiel.Image8.Enabled := True;
FormSpiel.Image8_1.Enabled := True;
end;

So ^^
Miniaturansicht angehängter Grafiken
delphi_1.jpg   delphi_2.png   delphi_3.png  

Geändert von XardasLP (23. Mär 2016 um 19:57 Uhr)
  Mit Zitat antworten Zitat