Changeset 6054 in orxonox.OLD for trunk/src/world_entities/npcs
- Timestamp:
- Dec 11, 2005, 6:23:42 PM (19 years ago)
- Location:
- trunk/src/world_entities/npcs
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npcs/npc.cc
r6004 r6054 59 59 } 60 60 State::getWorldEntityList()->remove(this); 61 this->removeNode(); 61 62 62 63 this->collider = entity; … … 68 69 this->setVisibiliy(false); 69 70 State::getWorldEntityList()->remove(this); 71 this->removeNode(); 70 72 } 71 73 } -
trunk/src/world_entities/npcs/npc_test.cc
r6004 r6054 58 58 59 59 60 void NPC2::collidesWith(WorldEntity* entity, const Vector& location)61 {62 if (entity->isA(CL_PROJECTILE))63 {64 PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z);65 this->applyForce(Vector(0,0,0)-location*1000);66 }67 else if (entity->isA(CL_PLAYER))68 this->applyForce(Vector(0,0,0)-location*100);69 else70 {71 this->setVisibiliy(false);72 State::getWorldEntityList()->remove(this);73 }74 }75 76 60 77 61 /** -
trunk/src/world_entities/npcs/npc_test.h
r6004 r6054 20 20 virtual void draw() const; 21 21 22 virtual void collidesWith (WorldEntity* entity, const Vector& location);23 24 25 22 private: 26 23 Vector randomRotAxis; -
trunk/src/world_entities/npcs/npc_test1.cc
r6004 r6054 46 46 47 47 48 void NPCTest1::collidesWith(WorldEntity* entity, const Vector& location)49 {50 if (entity->isA(CL_PROJECTILE) && entity != this->collider)51 {52 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z);53 // this->applyForce(Vector(0,0,0)-location*1000);54 if ((float)rand()/RAND_MAX < .3)55 {56 WorldEntity* powerUp = new TurretPowerUp();57 powerUp->setAbsCoor(this->getAbsCoor());58 State::getWorldEntityList()->add(powerUp);59 }60 else if ((float)rand()/RAND_MAX < .3)61 {62 WorldEntity* powerUp = new LaserPowerUp();63 powerUp->setAbsCoor(this->getAbsCoor());64 State::getWorldEntityList()->add(powerUp);65 }66 State::getWorldEntityList()->remove(this);67 68 this->collider = entity;69 }70 else if (entity->isA(CL_PLAYER))71 this->applyForce(Vector(0,0,0)-location*100);72 else if (entity->isA(CL_NPC))73 {74 this->setVisibiliy(false);75 State::getWorldEntityList()->remove(this);76 }77 }78 79 48 80 49 void NPCTest1::tick(float dt) -
trunk/src/world_entities/npcs/npc_test1.h
r6004 r6054 18 18 virtual void tick(float dt); 19 19 20 virtual void collidesWith (WorldEntity* entity, const Vector& location);21 22 23 20 private: 24 21 Vector randomRotAxis;
Note: See TracChangeset
for help on using the changeset viewer.