I'm really not one for introductions, it's basic but it could go many directions.

BEGIN{ unshift(@INC,"../blib"); } # in case OpenGL is built but not i +nstalled BEGIN{ unshift(@INC,"../blib/arch"); } # 5.002 gamma needs this BEGIN{ unshift(@INC,"../blib/lib"); } # 5.002 gamma needs this use OpenGL; use Term::ReadKey; use warnings; glpOpenWindow; glClearColor(0,0,0,1); glClear(GL_COLOR_BUFFER_BIT); glOrtho(-300,300,-300,300,-30,30); glColor3f(1,0,0); sub drawplane{ glBegin(GL_POLYGON); @pos=($_[0],$_[1]); my $rot = $_[2]*0.0174; my @point1=($pos[0],$pos[1]); my @point2=($point1[0]+(cos($rot+90)*10),$point1[1]+(sin($rot+90)*10)) +; my @point3=($point2[0]+(cos($rot+45)*6),$point2[1]+(sin($rot+45)*6)); my @point4=($point3[0]+(cos($rot)*4),$point3[1]+(sin($rot)*4)); my @point5=($point4[0]-(cos($rot+225)*8),$point4[1]-(sin($rot+225)*8)) +; glVertex2f($point1[0],$point1[1]); glVertex2f($point2[0],$point2[1]); glVertex2f($point3[0],$point3[1]); glVertex2f($point4[0],$point4[1]); glVertex2f($point5[0],$point5[1]); @point1=($pos[0],$pos[1]); @point2=($point1[0]+(cos($rot-90)*10),$point1[1]+(sin($rot-90)*10)); @point3=($point2[0]+(cos($rot-45)*6),$point2[1]+(sin($rot-45)*6)); @point4=($point3[0]+(cos($rot)*4),$point3[1]+(sin($rot)*4)); @point5=($point4[0]-(cos($rot-225)*8),$point4[1]-(sin($rot-225)*8)); glVertex2f($point1[0],$point1[1]); glVertex2f($point2[0],$point2[1]); glVertex2f($point3[0],$point3[1]); glVertex2f($point4[0],$point4[1]); glVertex2f($point5[0],$point5[1]); glEnd(); glpFlush(); } @pos=(0,0); $dir=0; $forwardspeed=0; $turnspeed=0; ReadMode 4; # Turn off controls keys @direction=(0,0); while (1==1){ if (defined ($key = ReadKey(-1))){if($key eq'a'){if($turnspeed<2){$tur +nspeed+=.7};};if($key eq'd'){if($turnspeed>-2){$turnspeed-=.7}} if($k +ey eq'w'){ if ($forwardspeed <.05){$forwardspeed+=.015} }} $dir+=$turnspeed; glClearColor(0,0,0,1); glClear(GL_COLOR_BUFFER_BIT); if ($forwardspeed >0){$forwardspeed/=1.05;} $turnspeed/=1.05; @direction=(($direction[0]/1.01)+(cos($dir*0.0174)*$forwardspeed),($di +rection[1]/1.01)+(sin($dir*0.0174)*$forwardspeed)); @pos=($pos[0]+$direction[0],$pos[1]+$direction[1]); drawplane($pos[0],$pos[1],$dir%360); select(undef,undef,undef, .02); }

In reply to I made a pilotable ship! by Pseudomander

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.