Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1994 in orxonox.OLD for orxonox/branches/dave/core/npc.cc


Ignore:
Timestamp:
Jun 21, 2004, 12:39:11 AM (20 years ago)
Author:
dave
Message:

orxonox/branches/dave:[test the Shit]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/dave/core/npc.cc

    r1858 r1994  
    2121#include <iostream>
    2222
     23
    2324using namespace std;
    2425
    2526
    26 NPC::NPC () {}
    27 
    28 
     27NPC::NPC ()
     28{
     29  hasDied = 0;
     30}
    2931
    3032NPC::~NPC () {}
    3133
    3234
    33 void NPC::setPosition(int x, int y, int z)
     35void NPC::setPosition(float x, float y, float z)
    3436{
    3537  xCor = x; yCor = y; zCor = z;
    3638}
    3739
    38 void NPC::getPosition(int* x, int* y, int* z)
     40void NPC::getPosition(float* x, float* y, float* z)
    3941{
    4042  *x = xCor;
     
    4345}
    4446
     47void NPC::setCollisionRadius(float r)
     48{
     49  collisionRadius = r;
     50}
     51
     52float NPC::getCollisionRadius()
     53{
     54  return collisionRadius;
     55}
     56
     57
     58void NPC::addAI(AI* ai)
     59{
     60
     61}
    4562
    4663void NPC::drawNPC(void)
    4764{
    48   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   
     73  }
    4974}
     75
     76
     77/* define the reaction, if the ship is been hit */
     78int NPC::hit()
     79{
     80  die();
     81  return 0;
     82}
     83
     84void NPC::die()
     85{
     86  hasDied = 1;
     87}
Note: See TracChangeset for help on using the changeset viewer.