Changeset 1994 in orxonox.OLD for orxonox/branches/dave/core/npc.cc
- Timestamp:
- Jun 21, 2004, 12:39:11 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/dave/core/npc.cc
r1858 r1994 21 21 #include <iostream> 22 22 23 23 24 using namespace std; 24 25 25 26 26 NPC::NPC () {} 27 28 27 NPC::NPC () 28 { 29 hasDied = 0; 30 } 29 31 30 32 NPC::~NPC () {} 31 33 32 34 33 void NPC::setPosition( int x, int y, int z)35 void NPC::setPosition(float x, float y, float z) 34 36 { 35 37 xCor = x; yCor = y; zCor = z; 36 38 } 37 39 38 void NPC::getPosition( int* x, int* y, int* z)40 void NPC::getPosition(float* x, float* y, float* z) 39 41 { 40 42 *x = xCor; … … 43 45 } 44 46 47 void NPC::setCollisionRadius(float r) 48 { 49 collisionRadius = r; 50 } 51 52 float NPC::getCollisionRadius() 53 { 54 return collisionRadius; 55 } 56 57 58 void NPC::addAI(AI* ai) 59 { 60 61 } 45 62 46 63 void NPC::drawNPC(void) 47 64 { 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 } 49 74 } 75 76 77 /* define the reaction, if the ship is been hit */ 78 int NPC::hit() 79 { 80 die(); 81 return 0; 82 } 83 84 void NPC::die() 85 { 86 hasDied = 1; 87 }
Note: See TracChangeset
for help on using the changeset viewer.