Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1896 in orxonox.OLD for orxonox/trunk/core/world.cc


Ignore:
Timestamp:
May 20, 2004, 1:01:57 AM (21 years ago)
Author:
patrick
Message:

orxonox/trunk: added ability to shoot. so check out the new release and shoot the fuck up

File:
1 edited

Legend:

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

    r1883 r1896  
    3333  lastNPC = null;
    3434  lastEnv = null;
     35  lastShoot = null;
    3536}
    3637
     
    128129
    129130/**
    130    \brief Remove Non-Player-Character
     131   \brief Add environmental object
     132   \param player A reference to the new env object
     133   
     134   Add a new Environment to the world. Env has to be initialised before.
     135*/
     136bool World::addShoot(ShootLaser* shoot)
     137{
     138  shootList* listMember = new shootList;
     139  listMember->shoot = shoot;
     140  if ( lastShoot != null )
     141    {
     142      listMember->number = lastShoot->number + 1;
     143      listMember->next = lastShoot;
     144    }
     145  else
     146    {
     147      listMember->number = 0;
     148      listMember->next = null;
     149    }
     150  lastShoot = listMember;
     151}
     152
     153
     154/**
     155   \brief Remove Non-Player Character
    131156   \param player A reference to the new npc object
    132157   
     
    162187    }
    163188  /* now draw the rest of the world: environement */
    164   /* second draw all npcs */
    165189  envList* tmpEnv = lastEnv;
    166190  while( tmpEnv != null )
     
    169193      tmpEnv = tmpEnv->next;
    170194    }
    171 
    172   /*
    173   glColor3f(0.0, 1.0, 0.0);
    174   glBegin(GL_LINES);
    175   for (int x = 0; x <= 35; x += 5)
    176     {
    177       glVertex3f((float)x, -10.0, 0.0);
    178       glVertex3f((float)x, 200.0, 0.0);
    179 
    180       glVertex3f(-(float)x, -10.0, 0.0);
    181       glVertex3f(-(float)x, 200.0, 0.0);
    182     }
    183   for (int x = -10; x<= 200; x += 5)
    184     {
    185       glVertex3f(-50.0, (float)x, 0.0);
    186       glVertex3f(50.0, (float)x, 0.0);
    187     }
    188   glEnd();
    189   */
    190  
     195  /* now draw all the shoots (many) */
     196  shootList* tmpShoot = lastShoot;
     197  while( tmpShoot != null )
     198    {
     199      (*tmpShoot->shoot).drawShoot();
     200      tmpShoot = tmpShoot->next;
     201    }
    191202 
    192203  glColor3f(0.0, 1.0, 0.0);
Note: See TracChangeset for help on using the changeset viewer.