Changeset 6054 in orxonox.OLD for trunk/src/world_entities/npcs/npc_test1.cc
- Timestamp:
- Dec 11, 2005, 6:23:42 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note: See TracChangeset
for help on using the changeset viewer.