<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Spiel-Optimierung, zwei Timer in einer Form]]></title><description><![CDATA[<p>Hi,</p>
<p>ich bin dabei ein Spiel zu programmieren, bzw.: ein Grunderüst zu erstellen ...</p>
<p>Da ich nicht mich nicht mit Spiele programieren auskenne hoffe ich HIER Hilfe zu erhalten.</p>
<p>In meinem &quot;Spiel&quot; soll ein kleines Viereck, á la Tetris herunterfallen, dies habe ich mit einem Timer gemacht, und ein anderer Timer fragt die Tasten-Eingabe ab. Für die spätere Kollision wird alles in einem Array gespeichert.<br />
1.) kann ich das irgendwie einfacher/anders/besser machen ?? Form1:OnKeyDown ...</p>
<p>Wenn ihr dann mein &quot;Spiel&quot; im Builder ausführt werdet Ihr sehen, dass beim schnellen Links und Rechts (Zickzack) auf dem rechten StringGrid Einträge zurückbleiben ...<br />
2.) Wieso ??</p>
<p>Anregungen, Tips oder Gut/Schlecht Meinungen sind ausdrücklich erlaubt.</p>
<p>jetzt endlich der Code:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;tatris_ver04_cpp.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
TImage *Image[100];
int i=0,U=0,R=0;
int koordi[100][100];
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void bild_erstelln()
{
 i++;
 Image[i]= new TImage(Form1);
 Image[i]-&gt;Parent = Form1-&gt;Panel1;
 Image[i]-&gt;Width = 15;
 Image[i]-&gt;Height = 15;
 Image[i]-&gt;Top = 0;
 Image[i]-&gt;Left = 60;
 Image[i]-&gt;Visible  = true;
// Image[i]-&gt;AutoSize = true;
 Form1-&gt;ImageList1-&gt;GetBitmap(0,Image[i]-&gt;Picture-&gt;Bitmap);
// Form1-&gt;StringGrid2-&gt;Cells[0][0] = &quot;Cre&quot;;
// koordi[0][0] = 1;
 //Form1-&gt;StringGrid2-&gt;Row = 0;
/* Form1-&gt;Label9-&gt;Caption = Form1-&gt;StringGrid1-&gt;ColCount;
 Form1-&gt;Label1-&gt;Caption =  Form1-&gt;StringGrid1-&gt;Col;
 Form1-&gt;Label2-&gt;Caption = Form1-&gt;StringGrid1-&gt;Row;
 Form1-&gt;Label6-&gt;Caption = Row;
*/}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
  /*if (GetAsyncKeyState(VK_UP) &lt; 0 &amp;&amp; Image[i]-&gt;Top &gt;= 1)
  {
   Image[i]-&gt;Top = Image[i]-&gt;Top-15;
  } */
  U = Image[i]-&gt; Top / 15;
  R = Image[i]-&gt; Left / 15;
   if (GetAsyncKeyState(VK_DOWN) &lt; 0 &amp;&amp; Image[i]-&gt;Top &lt;= Panel1-&gt;Height-Image[i]-&gt;Height-15)
  {
   Image[i]-&gt;Top = Image[i]-&gt;Top+15;
   U++;
   koordi[R][U] = 2;
   koordi[R][U-1] = 0;
  }
  if (GetAsyncKeyState(VK_RIGHT) &lt; 0 &amp;&amp; Image[i]-&gt;Left &lt;= Panel1-&gt;Width-Image[i]-&gt;Width-2)
  {
   Image[i]-&gt;Left = Image[i]-&gt;Left+15;
   R++;
   koordi[R][U] = 3;
   koordi[R-1][U] = 0;
  }
   if (GetAsyncKeyState(VK_LEFT) &lt; 0 &amp;&amp; Image[i]-&gt;Left &gt;= 1)
  {
  Image[i]-&gt;Left = Image[i]-&gt;Left-15;
   R--;
   koordi[R][U] = 4;
   koordi[R+1][U] = 0;
  }
  Label1-&gt;Caption = Panel1-&gt;Width-Image[i]-&gt;Left;
  Label2-&gt;Caption = Image[i]-&gt;Top;
  Label3-&gt;Caption = Image[i]-&gt;Left;

  for (int x = 0; x &lt;= 10; x++)
 {
  for (int y = 0; y &lt;= 19; y++)
  {
   Form1-&gt;StringGrid1-&gt;Cells[x][y] = koordi[x][y];
  }
 }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::nach_unten(TObject *Sender) // grhört zu Timer2
{
 U = Image[i]-&gt; Top / 15;
 R = Image[i]-&gt; Left / 15;
 if (Image[i]-&gt;Top &lt; Panel1-&gt;Height-Image[i]-&gt;Height)
 {
  Image[i]-&gt;Top = Image[i]-&gt;Top+1;

  koordi[R][U] = 11;
  koordi[R][U-1] = 0;

 }
   if (Image[i]-&gt;Top &gt;= Panel1-&gt;Height-Image[i]-&gt;Height)
   bild_erstelln();
 //Label4-&gt;Caption = Panel1-&gt;Height-Image[i]-&gt;Height;
/* if (koordi[R][U+1] == 1)
  bild_erstelln();
*/}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
 bild_erstelln();
}
//---------------------------------------------------------------------------
</code></pre>
<p>so sieht mein Programm/Spiel aus:</p>
<pre><code>object Form1: TForm1
  Left = 220
  Top = 113
  Width = 329
  Height = 377
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 1
    Top = 304
    Width = 32
    Height = 13
    Caption = 'Label1'
  end
  object Label2: TLabel
    Left = 41
    Top = 304
    Width = 32
    Height = 13
    Caption = 'Label2'
  end
  object Label3: TLabel
    Left = 81
    Top = 304
    Width = 32
    Height = 13
    Caption = 'Label3'
  end
  object Label4: TLabel
    Left = 121
    Top = 304
    Width = 32
    Height = 13
    Caption = 'Label4'
  end
  object Panel1: TPanel
    Left = 0
    Top = 0
    Width = 150
    Height = 300
    Color = clSkyBlue
    TabOrder = 0
  end
  object ScrollBar1: TScrollBar
    Left = 1
    Top = 320
    Width = 144
    Height = 19
    PageSize = 0
    TabOrder = 2
  end
  object StringGrid1: TStringGrid
    Left = 153
    Top = 0
    Width = 165
    Height = 325
    ColCount = 10
    DefaultColWidth = 15
    DefaultRowHeight = 15
    FixedCols = 0
    RowCount = 20
    FixedRows = 0
    TabOrder = 1
  end
  object Timer1: TTimer
    Tag = 1
    Interval = 100
    OnTimer = Timer1Timer
    Left = 249
    Top = 32
  end
  object Timer2: TTimer
    Interval = 100
    OnTimer = nach_unten
    Left = 201
    Top = 88
  end
  object ImageList1: TImageList
    Left = 257
    Top = 104
    Bitmap = {
      494C010101000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
      0000000000003600000028000000400000001000000001002000000000000010
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A0000000000000000000000
      000000000000000000000000000000000000FFC58A0000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FFC58A00FFC58A00FFC5
      8A00FFC58A00FFC58A00FFC58A0000000000FFC58A00FFC58A00FFC58A00FFC5
      8A00FFC58A00FFC58A00FFC58A00000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A0000000000000000000000
      000000000000000000000000000000000000FFC58A0000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FFC58A00FFC58A00FFC5
      8A00FFC58A00FFC58A00FFC58A0000000000FFC58A00FFC58A00FFC58A00FFC5
      8A00FFC58A00FFC58A00FFC58A00000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000424D3E000000000000003E000000
      2800000040000000100000000100010000000000800000000000000000000000
      000000000000000000000000FFFFFF0000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000}
  end
end
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/180257/spiel-optimierung-zwei-timer-in-einer-form</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 16:01:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/180257.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 30 Apr 2007 16:00:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Spiel-Optimierung, zwei Timer in einer Form on Mon, 30 Apr 2007 16:02:37 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich bin dabei ein Spiel zu programmieren, bzw.: ein Grunderüst zu erstellen ...</p>
<p>Da ich nicht mich nicht mit Spiele programieren auskenne hoffe ich HIER Hilfe zu erhalten.</p>
<p>In meinem &quot;Spiel&quot; soll ein kleines Viereck, á la Tetris herunterfallen, dies habe ich mit einem Timer gemacht, und ein anderer Timer fragt die Tasten-Eingabe ab. Für die spätere Kollision wird alles in einem Array gespeichert.<br />
1.) kann ich das irgendwie einfacher/anders/besser machen ?? Form1:OnKeyDown ...</p>
<p>Wenn ihr dann mein &quot;Spiel&quot; im Builder ausführt werdet Ihr sehen, dass beim schnellen Links und Rechts (Zickzack) auf dem rechten StringGrid Einträge zurückbleiben ...<br />
2.) Wieso ??</p>
<p>Anregungen, Tips oder Gut/Schlecht Meinungen sind ausdrücklich erlaubt.</p>
<p>jetzt endlich der Code:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;tatris_ver04_cpp.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
TImage *Image[100];
int i=0,U=0,R=0;
int koordi[100][100];
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void bild_erstelln()
{
 i++;
 Image[i]= new TImage(Form1);
 Image[i]-&gt;Parent = Form1-&gt;Panel1;
 Image[i]-&gt;Width = 15;
 Image[i]-&gt;Height = 15;
 Image[i]-&gt;Top = 0;
 Image[i]-&gt;Left = 60;
 Image[i]-&gt;Visible  = true;
// Image[i]-&gt;AutoSize = true;
 Form1-&gt;ImageList1-&gt;GetBitmap(0,Image[i]-&gt;Picture-&gt;Bitmap);
// Form1-&gt;StringGrid2-&gt;Cells[0][0] = &quot;Cre&quot;;
// koordi[0][0] = 1;
 //Form1-&gt;StringGrid2-&gt;Row = 0;
/* Form1-&gt;Label9-&gt;Caption = Form1-&gt;StringGrid1-&gt;ColCount;
 Form1-&gt;Label1-&gt;Caption =  Form1-&gt;StringGrid1-&gt;Col;
 Form1-&gt;Label2-&gt;Caption = Form1-&gt;StringGrid1-&gt;Row;
 Form1-&gt;Label6-&gt;Caption = Row;
*/}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
  /*if (GetAsyncKeyState(VK_UP) &lt; 0 &amp;&amp; Image[i]-&gt;Top &gt;= 1)
  {
   Image[i]-&gt;Top = Image[i]-&gt;Top-15;
  } */
  U = Image[i]-&gt; Top / 15;
  R = Image[i]-&gt; Left / 15;
   if (GetAsyncKeyState(VK_DOWN) &lt; 0 &amp;&amp; Image[i]-&gt;Top &lt;= Panel1-&gt;Height-Image[i]-&gt;Height-15)
  {
   Image[i]-&gt;Top = Image[i]-&gt;Top+15;
   U++;
   koordi[R][U] = 2;
   koordi[R][U-1] = 0;
  }
  if (GetAsyncKeyState(VK_RIGHT) &lt; 0 &amp;&amp; Image[i]-&gt;Left &lt;= Panel1-&gt;Width-Image[i]-&gt;Width-2)
  {
   Image[i]-&gt;Left = Image[i]-&gt;Left+15;
   R++;
   koordi[R][U] = 3;
   koordi[R-1][U] = 0;
  }
   if (GetAsyncKeyState(VK_LEFT) &lt; 0 &amp;&amp; Image[i]-&gt;Left &gt;= 1)
  {
  Image[i]-&gt;Left = Image[i]-&gt;Left-15;
   R--;
   koordi[R][U] = 4;
   koordi[R+1][U] = 0;
  }
  Label1-&gt;Caption = Panel1-&gt;Width-Image[i]-&gt;Left;
  Label2-&gt;Caption = Image[i]-&gt;Top;
  Label3-&gt;Caption = Image[i]-&gt;Left;

  for (int x = 0; x &lt;= 10; x++)
 {
  for (int y = 0; y &lt;= 19; y++)
  {
   Form1-&gt;StringGrid1-&gt;Cells[x][y] = koordi[x][y];
  }
 }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::nach_unten(TObject *Sender) // grhört zu Timer2
{
 U = Image[i]-&gt; Top / 15;
 R = Image[i]-&gt; Left / 15;
 if (Image[i]-&gt;Top &lt; Panel1-&gt;Height-Image[i]-&gt;Height)
 {
  Image[i]-&gt;Top = Image[i]-&gt;Top+1;

  koordi[R][U] = 11;
  koordi[R][U-1] = 0;

 }
   if (Image[i]-&gt;Top &gt;= Panel1-&gt;Height-Image[i]-&gt;Height)
   bild_erstelln();
 //Label4-&gt;Caption = Panel1-&gt;Height-Image[i]-&gt;Height;
/* if (koordi[R][U+1] == 1)
  bild_erstelln();
*/}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
 bild_erstelln();
}
//---------------------------------------------------------------------------
</code></pre>
<p>so sieht mein Programm/Spiel aus:</p>
<pre><code>object Form1: TForm1
  Left = 220
  Top = 113
  Width = 329
  Height = 377
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 1
    Top = 304
    Width = 32
    Height = 13
    Caption = 'Label1'
  end
  object Label2: TLabel
    Left = 41
    Top = 304
    Width = 32
    Height = 13
    Caption = 'Label2'
  end
  object Label3: TLabel
    Left = 81
    Top = 304
    Width = 32
    Height = 13
    Caption = 'Label3'
  end
  object Label4: TLabel
    Left = 121
    Top = 304
    Width = 32
    Height = 13
    Caption = 'Label4'
  end
  object Panel1: TPanel
    Left = 0
    Top = 0
    Width = 150
    Height = 300
    Color = clSkyBlue
    TabOrder = 0
  end
  object ScrollBar1: TScrollBar
    Left = 1
    Top = 320
    Width = 144
    Height = 19
    PageSize = 0
    TabOrder = 2
  end
  object StringGrid1: TStringGrid
    Left = 153
    Top = 0
    Width = 165
    Height = 325
    ColCount = 10
    DefaultColWidth = 15
    DefaultRowHeight = 15
    FixedCols = 0
    RowCount = 20
    FixedRows = 0
    TabOrder = 1
  end
  object Timer1: TTimer
    Tag = 1
    Interval = 100
    OnTimer = Timer1Timer
    Left = 249
    Top = 32
  end
  object Timer2: TTimer
    Interval = 100
    OnTimer = nach_unten
    Left = 201
    Top = 88
  end
  object ImageList1: TImageList
    Left = 257
    Top = 104
    Bitmap = {
      494C010101000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
      0000000000003600000028000000400000001000000001002000000000000010
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A0000000000000000000000
      000000000000000000000000000000000000FFC58A0000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FFC58A00FFC58A00FFC5
      8A00FFC58A00FFC58A00FFC58A0000000000FFC58A00FFC58A00FFC58A00FFC5
      8A00FFC58A00FFC58A00FFC58A00000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A0000000000000000000000
      000000000000000000000000000000000000FFC58A0000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF8000000000000000000000FFC58A00FF800000FF800000FF80
      0000FF800000FF80000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000FFC58A00FFC58A00FFC58A00FFC5
      8A00FFC58A00FFC58A00FFC58A0000000000FFC58A00FFC58A00FFC58A00FFC5
      8A00FFC58A00FFC58A00FFC58A00000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000424D3E000000000000003E000000
      2800000040000000100000000100010000000000800000000000000000000000
      000000000000000000000000FFFFFF0000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000}
  end
end
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1276439</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1276439</guid><dc:creator><![CDATA[Huberts]]></dc:creator><pubDate>Mon, 30 Apr 2007 16:02:37 GMT</pubDate></item><item><title><![CDATA[Reply to Spiel-Optimierung, zwei Timer in einer Form on Mon, 30 Apr 2007 16:36:07 GMT]]></title><description><![CDATA[<p>Hallo</p>
<blockquote>
<p>In meinem &quot;Spiel&quot; soll ein kleines Viereck, á la Tetris herunterfallen, dies habe ich mit einem Timer gemacht, und ein anderer Timer fragt die Tasten-Eingabe ab. Für die spätere Kollision wird alles in einem Array gespeichert.<br />
1.) kann ich das irgendwie einfacher/anders/besser machen ?? Form1:OnKeyDown ...</p>
</blockquote>
<p>Ein Timer sollte reichen. OnKeyDown wäre im Gegensatz zu Get..KeyState ein anderes Prinzip, dürfte aber für deine Zwecke keine effektiven Änderungen erreichen.</p>
<blockquote>
<p>Wenn ihr dann mein &quot;Spiel&quot; im Builder ausführt werdet Ihr sehen, dass beim schnellen Links und Rechts (Zickzack) auf dem rechten StringGrid Einträge zurückbleiben ...<br />
2.) Wieso ??</p>
</blockquote>
<p>Weil TStringGrid nicht das richtige Control für deine Zwecke ist.<br />
Benutzt lieber eine TPaintBox um mit Canvas-Methoden direkt die Spielelemente zu zeichnen. Hier hast du viel mehr Möglichkeiten zu optimieren und lernen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1276460</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1276460</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 30 Apr 2007 16:36:07 GMT</pubDate></item><item><title><![CDATA[Reply to Spiel-Optimierung, zwei Timer in einer Form on Tue, 01 May 2007 00:03:56 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/7971"><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/7971">@akari</a></a> danke für die schnelle hilfe...</p>
<p>mein spielstein ist ein Image aus einer ImageList,<br />
das StringGrid erleichtert mir die spätere kollisionserkennung,<br />
ich speichere die koordinaten vom spielstein in einem raster (array),<br />
der Timer bewegt den stein um die höhe des steines nach unten, in meinem Fall um 15,</p>
<p>das mit den zwei bzw einen Timer habe ich verstanden, auch das mit dem OnKeyDown,<br />
nur hast du <a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/7971"><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/7971">@akari</a></a> -glaube ich- nicht mein zweites problem verstanden,<br />
das StingGrid zweigt mir die position des steines an, ich kennzeichne das mit einer 1,</p>
<p>mein porblem ist noch bei dem fall, wenn der stein nach unten fällt und gleichzeitig ich den stein zur seite bewege, dann entsteht ein &quot;Treppen-Effekt&quot; , so wie ich das nenne,</p>
<pre><code>X_______   &lt;- nach links ... nach rechts -&gt; ________X
______|                                                   |_______
an der stelle X bleibt ein wert übrig, den ich nicht haben will,
</code></pre>
<p>ich habe mir den Vorschlag von akari wegen der TPaintBox mit Canvas-Methode angeschaut,<br />
das wäre ja nur eine andere möglichkeit ein spielstein darzustellen,<br />
aber da kommt mir die frage auf, wie soll ich dann die kollision machen,<br />
da stört immer noch der &quot;Treppen&quot; effekt...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1276696</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1276696</guid><dc:creator><![CDATA[Huberts]]></dc:creator><pubDate>Tue, 01 May 2007 00:03:56 GMT</pubDate></item></channel></rss>