Changeset 8872 in orxonox.OLD for branches/single_player_map/src/world_entities/door.cc
- Timestamp:
- Jun 28, 2006, 4:56:34 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/world_entities/door.cc
r8870 r8872 62 62 { 63 63 this->setClassID(CL_DOOR, "Door"); 64 this->toList(OM_ GROUP_00);64 this->toList(OM_COMMON); 65 65 66 66 this->lastCollided = NULL; … … 76 76 WorldEntity::loadParams(root); 77 77 78 LoadParam(root, "md2animation", this, Door, setAnim)79 .describe("sets the animation of the md2 model")80 .defaultValues(1);78 // LoadParam(root, "", this, Door, set) 79 // .describe("sets the animation of the md2 model") 80 // .defaultValues(1); 81 81 82 82 } … … 95 95 ((InteractiveModel*)this->getModel(0))->tick(time); 96 96 97 }98 97 99 100 void Door::collidesWith(WorldEntity* entity, const Vector& location)101 {102 if( this->lastCollided != entity)103 {104 this->destroy();105 this->lastCollided = entity;106 107 if(State::getGameRules())108 State::getGameRules()->registerKill(Kill(entity, this));109 }110 98 } 111 99 112 100 113 101 114 void Door::destroy() 102 /** 103 * checks if the door is open 104 */ 105 void Door::checkOpen() 115 106 { 116 if( this->bDeath)117 return;118 107 119 this->bDeath = true;120 int randi = (int)(5.0f * (float)rand()/(float)RAND_MAX);121 108 122 PRINTF(0)("randi = %i\n", randi);123 124 if( randi == 1)125 this->setAnim(DEATH_FALLBACK, MD2_ANIM_ONCE);126 else if( randi == 2)127 this->setAnim(DEATH_FALLFORWARD, MD2_ANIM_ONCE);128 else if( randi == 3)129 this->setAnim(DEATH_FALLBACKSLOW, MD2_ANIM_ONCE);130 else if( randi == 4)131 this->setAnim(CROUCH_DEATH, MD2_ANIM_ONCE);132 else133 this->setAnim(DEATH_FALLBACK, MD2_ANIM_ONCE);134 109 } 135 110 111 112
Note: See TracChangeset
for help on using the changeset viewer.