Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1931 in orxonox.OLD for orxonox/trunk/core/npc.cc


Ignore:
Timestamp:
Jun 9, 2004, 10:49:04 AM (21 years ago)
Author:
patrick
Message:

orxonox/trunk/core: speed of ground, shoot enemies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/core/npc.cc

    r1904 r1931  
    2525
    2626
    27 NPC::NPC () {}
     27NPC::NPC ()
     28{
     29  hasDied = 0;
     30}
    2831
    2932NPC::~NPC () {}
     
    5861}
    5962
    60 
    6163void NPC::drawNPC(void)
    6264{
    63   glPushMatrix();
    64   glTranslatef(xCor, yCor, 3.0);
    65   //glScalef(1.0, 3.0, 1.0);
    66   glutWireSphere(1.0, 10, 10);
    67   glPopMatrix();
    68   //cout << "Player::drawNPC()" << endl;
     65  /* fix: died flag approach is very stupid, just to show @ convention */
     66  if( hasDied == 0 ) {
     67    glPushMatrix();
     68    glTranslatef(xCor, yCor, 3.0);
     69    //glScalef(1.0, 3.0, 1.0);
     70    glutWireSphere(1.0, 10, 10);
     71    glPopMatrix();
     72  }
    6973}
     74
     75
     76/* define the reaction, if the ship is been hit */
     77int NPC::hit()
     78{
     79  die();
     80  return 0;
     81}
     82
     83void NPC::die()
     84{
     85  hasDied = 1;
     86}
Note: See TracChangeset for help on using the changeset viewer.