<?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[&amp;quot;Hubschrauberspiel&amp;quot; noch nicht Fehlerlos]]></title><description><![CDATA[<p>Hallo, habe folgendes Programm geschrieben, und weiß nicht ganz, wie ich die Kollisionsabfrage machen soll.<br />
Könnt ihr mir helfen?<br />
Wenn ihr das braucht: Ich programmiere im Borland 5 mit c++ in der Konsole.</p>
<pre><code class="language-cpp">#include &lt;conio&gt;
#include &lt;iomanip&gt;
#include &lt;vcl&gt;

//------Variablendeklaration---------------------------------------------------

int dxh=37, dyh=2;
int dxg=27, dyg=28;
int dxs=37, dys;

void Hubschrauber (int dx);
void Schuss (void);
void Gegner1 (void);

//---Unterprogramm--------------------------------------------------------------

void Hubschrauber (int dx)
{       
        gotoxy(dxh+4,dyh);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh,dyh);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+3,dyh);
        cout&lt;&lt;&quot;O&quot;;
        gotoxy(dxh+2,dyh);
        cout&lt;&lt;&quot;-&quot;;
        gotoxy(dxh+1,dyh);
        cout&lt;&lt;&quot;o&quot;;
        gotoxy(dxh+3,dyh+1);
        cout&lt;&lt;'\xEE';
        gotoxy(dxh+4,dyh+1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+5,dyh);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+5,dyh+1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+2,dyh+1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+1,dyh+1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+4,dyh-1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+2,dyh-1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh-1,dyh);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+5,dyh-1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+1,dyh-1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+3,dyh-1);
        cout&lt;&lt;&quot;_&quot;;
}

void Schuss (void)
{
    for(dys=4; dys&lt;=30; dys++)
    {
        gotoxy(dxs+3,dys);
        cout&lt;&lt;&quot;|&quot;;
        gotoxy(dxs+2,2);
        cout&lt;&lt;&quot;-&quot;;
        Sleep(30);
        gotoxy(dxs+3,dys-1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxs+2,2);
        cout&lt;&lt;&quot;-&quot;;
    }
}

void Gegner1 (void)
{
    gotoxy(dxg,dyg);
    cout&lt;&lt;'\x01';
    gotoxy(dxg,dyg+1);
    cout&lt;&lt;&quot;0&quot;;
    gotoxy(dxg-1,dyg+1);
    cout&lt;&lt;&quot;`&quot;;
    gotoxy(dxg+1,dyg+1);
    cout&lt;&lt;'\x60';
    gotoxy(dxg+1,dyg+2);
    cout&lt;&lt;&quot;`&quot;;
    gotoxy(dxg-1,dyg+2);
    cout&lt;&lt;'\x60';
}

//-----------------------------------------------------------------------------

int main(int argc, char **argv)
{
     _setcursortype(_NOCURSOR);
    clrscr();
    do
    {
        for (int i=1; i&lt;2; i++)
        {
            if(dxh&gt;=76)
            {
                return 0;
            }

            if(dxh&lt;=0)
            {
                return 0;
            }

            Gegner1();
            i--;
            if(kbhit())
            {
                switch(getch())
                {
                    case 77: 2*dxh++; 2*dxs++; Hubschrauber(dxh); break;
                    case 75: 2*dxh--; 2*dxs--; Hubschrauber(dxh); break;
                    case 80: Schuss();                            break;
                }
            }
        }
    }
    while(getch()!='q');
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/181194/quot-hubschrauberspiel-quot-noch-nicht-fehlerlos</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 05:10:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/181194.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 May 2007 20:26:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &amp;quot;Hubschrauberspiel&amp;quot; noch nicht Fehlerlos on Thu, 10 May 2007 20:26:48 GMT]]></title><description><![CDATA[<p>Hallo, habe folgendes Programm geschrieben, und weiß nicht ganz, wie ich die Kollisionsabfrage machen soll.<br />
Könnt ihr mir helfen?<br />
Wenn ihr das braucht: Ich programmiere im Borland 5 mit c++ in der Konsole.</p>
<pre><code class="language-cpp">#include &lt;conio&gt;
#include &lt;iomanip&gt;
#include &lt;vcl&gt;

//------Variablendeklaration---------------------------------------------------

int dxh=37, dyh=2;
int dxg=27, dyg=28;
int dxs=37, dys;

void Hubschrauber (int dx);
void Schuss (void);
void Gegner1 (void);

//---Unterprogramm--------------------------------------------------------------

void Hubschrauber (int dx)
{       
        gotoxy(dxh+4,dyh);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh,dyh);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+3,dyh);
        cout&lt;&lt;&quot;O&quot;;
        gotoxy(dxh+2,dyh);
        cout&lt;&lt;&quot;-&quot;;
        gotoxy(dxh+1,dyh);
        cout&lt;&lt;&quot;o&quot;;
        gotoxy(dxh+3,dyh+1);
        cout&lt;&lt;'\xEE';
        gotoxy(dxh+4,dyh+1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+5,dyh);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+5,dyh+1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+2,dyh+1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+1,dyh+1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+4,dyh-1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+2,dyh-1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh-1,dyh);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+5,dyh-1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+1,dyh-1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxh+3,dyh-1);
        cout&lt;&lt;&quot;_&quot;;
}

void Schuss (void)
{
    for(dys=4; dys&lt;=30; dys++)
    {
        gotoxy(dxs+3,dys);
        cout&lt;&lt;&quot;|&quot;;
        gotoxy(dxs+2,2);
        cout&lt;&lt;&quot;-&quot;;
        Sleep(30);
        gotoxy(dxs+3,dys-1);
        cout&lt;&lt;&quot; &quot;;
        gotoxy(dxs+2,2);
        cout&lt;&lt;&quot;-&quot;;
    }
}

void Gegner1 (void)
{
    gotoxy(dxg,dyg);
    cout&lt;&lt;'\x01';
    gotoxy(dxg,dyg+1);
    cout&lt;&lt;&quot;0&quot;;
    gotoxy(dxg-1,dyg+1);
    cout&lt;&lt;&quot;`&quot;;
    gotoxy(dxg+1,dyg+1);
    cout&lt;&lt;'\x60';
    gotoxy(dxg+1,dyg+2);
    cout&lt;&lt;&quot;`&quot;;
    gotoxy(dxg-1,dyg+2);
    cout&lt;&lt;'\x60';
}

//-----------------------------------------------------------------------------

int main(int argc, char **argv)
{
     _setcursortype(_NOCURSOR);
    clrscr();
    do
    {
        for (int i=1; i&lt;2; i++)
        {
            if(dxh&gt;=76)
            {
                return 0;
            }

            if(dxh&lt;=0)
            {
                return 0;
            }

            Gegner1();
            i--;
            if(kbhit())
            {
                switch(getch())
                {
                    case 77: 2*dxh++; 2*dxs++; Hubschrauber(dxh); break;
                    case 75: 2*dxh--; 2*dxs--; Hubschrauber(dxh); break;
                    case 80: Schuss();                            break;
                }
            }
        }
    }
    while(getch()!='q');
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1282669</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1282669</guid><dc:creator><![CDATA[Friedfischer]]></dc:creator><pubDate>Thu, 10 May 2007 20:26:48 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;Hubschrauberspiel&amp;quot; noch nicht Fehlerlos on Fri, 11 May 2007 08:07:24 GMT]]></title><description><![CDATA[<p>wtf?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1282825</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1282825</guid><dc:creator><![CDATA[Helium]]></dc:creator><pubDate>Fri, 11 May 2007 08:07:24 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;Hubschrauberspiel&amp;quot; noch nicht Fehlerlos on Fri, 11 May 2007 12:19:34 GMT]]></title><description><![CDATA[<p>kann des sein das du <em><strong>#include</strong> &lt;iostream&gt;</em> nich hast und dass du ein <em><strong>using namespace</strong> std;</em> noch brauchst??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1282972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1282972</guid><dc:creator><![CDATA[kaffee]]></dc:creator><pubDate>Fri, 11 May 2007 12:19:34 GMT</pubDate></item></channel></rss>