- Timestamp:
- Jul 3, 2006, 2:17:40 PM (18 years ago)
- Location:
- branches/single_player_map/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/lib/collision_reaction/cr_object_damage.cc
r9031 r9035 56 56 float damage = 0.0f; 57 57 58 //PRINTF(0)("Dealing damage - Handling collision: %s vs %s\n",59 //collision->getEntityA()->getClassName(),60 //collision->getEntityB()->getClassName());58 PRINTF(0)("Dealing damage - Handling collision: %s vs %s\n", 59 collision->getEntityA()->getClassName(), 60 collision->getEntityB()->getClassName()); 61 61 62 62 // the collision damage been dealed by the entity … … 64 64 damage = collision->getEntityB()->getDamage(); 65 65 collision->getEntityA()->hit(damage, collision->getEntityB()); 66 PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityA()->getClassName()); 66 67 } 67 // PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityA()->getClassName());68 68 69 69 if( collision->isEntityBCollide()) { 70 70 damage = collision->getEntityA()->getDamage(); 71 71 collision->getEntityB()->hit(damage, collision->getEntityA()); 72 PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityB()->getClassName()); 72 73 } 73 // PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityB()->getClassName());74 74 75 75 collision->flushCollisionEvents(); -
branches/single_player_map/src/story_entities/game_world.cc
r8894 r9035 308 308 /* update the state */ 309 309 //this->update (); /// LESS REDUNDANCY. 310 //PNode::getNullParent()->updateNode(this->dtS);310 PNode::getNullParent()->updateNode(this->dtS); 311 311 312 312 -
branches/single_player_map/src/world_entities/npcs/generic_npc.cc
r9032 r9035 40 40 ->addMethod("turnTo", ExecutorLua1<GenericNPC,float>(&GenericNPC::turnTo)) 41 41 ->addMethod("finalGoalReached", ExecutorLua0ret<GenericNPC,bool>(&GenericNPC::finalGoalReached)) 42 // Animation and sound43 ->addMethod("playAnimation", ExecutorLua2<GenericNPC,int,int>(&GenericNPC::playAnimation))44 ->addMethod("playSound", ExecutorLua1<GenericNPC,const std::string&>(&GenericNPC::playSound))45 42 // Display 46 43 ->addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide)) … … 91 88 92 89 // collision reaction registration 93 this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);90 // this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY); 94 91 } 95 92 … … 172 169 * @param filename: name of the file 173 170 */ 174 void GenericNPC::playSound( const std::string&filename)171 void GenericNPC::playSound(std::string filename) 175 172 {} 176 173 … … 199 196 200 197 Vector dir = (currentAnimation.v - this->getAbsCoor()); 201 dir.y = 0.0f;198 // dir.y = 0.0f; 202 199 dir.getNormalized(); 203 200 this->setAbsDir(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0))); … … 267 264 268 265 Vector dir = (currentAnimation.v - this->getAbsCoor()); 269 dir.y = 0.0f;266 // dir.y = 0.0f; 270 267 dir.getNormalized(); 271 268 this->setAbsDirSoft(Quaternion(dir, Vector(0.0, 1.0, 0.0)) * Quaternion(-M_PI_2, Vector(0.0, 1.0, 0.0)), 4.0); … … 478 475 else 479 476 { 480 dest.y = 0.0f; 481 this->shiftCoor(dest.getNormalized() * currentAnimation.speed * dt); 482 477 // dest.y = 0.0f; 478 Vector move = dest.getNormalized() * currentAnimation.speed * dt; 479 this->shiftCoor(move); 480 PRINTF(0)("name %s, move:\n", this->getName()); 481 move.debug(); 482 // this->shiftCoor(Vector(0.0, 1.0, 1.0)); 483 483 } 484 484 } … … 525 525 } 526 526 527 // physical falling of the player 528 if( !this->isOnGround()) 529 { 530 this->fallVelocity += 300.0f * dt; 531 velocity -= Vector(0.0, 1.0, 0.0) * this->fallVelocity; 532 // PRINTF(0)("%s is not on ground\n", this->getName()); 533 } 534 else 535 { 536 this->fallVelocity = 0.0f; 537 } 538 539 this->shiftCoor(Vector(0, -this->fallVelocity * dt,0)); 527 // // physical falling of the player 528 // if( !this->isOnGround()) 529 // { 530 // this->fallVelocity += 300.0f * dt; 531 // velocity -= Vector(0.0, 1.0, 0.0) * this->fallVelocity; 532 // // PRINTF(0)("%s is not on ground\n", this->getName()); 533 // 534 // this->shiftCoor(Vector(0, -this->fallVelocity * dt,0)); 535 // 536 // } 537 // else 538 // { 539 // this->fallVelocity = 0.0f; 540 // } 540 541 541 542 } -
branches/single_player_map/src/world_entities/world_entity.cc
r9008 r9035 82 82 83 83 // registering default reactions: 84 this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY);84 this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, /*CL_WORLD_ENTITY*/ CL_PROJECTILE); 85 85 86 86 this->toList(OM_NULL);
Note: See TracChangeset
for help on using the changeset viewer.