Changeset 6973 in orxonox.OLD for trunk/src/world_entities/power_ups/power_up.cc
- Timestamp:
- Feb 2, 2006, 10:20:16 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/power_ups/power_up.cc
r6815 r6973 21 21 #include "primitive_model.h" 22 22 23 #include " assert.h"23 #include "load_param.h" 24 24 25 25 using namespace std; … … 29 29 this->setClassID(CL_POWER_UP, "PowerUp"); 30 30 31 this->respawnType = RESPAWN_ NONE;31 this->respawnType = RESPAWN_TIME; 32 32 this->respawnStart = 10; 33 33 this->model = NULL; … … 39 39 this->buildObbTree( 4); 40 40 this->sphereMaterial = new Material; 41 this->sphereMaterial->setTransparency(. 1);41 this->sphereMaterial->setTransparency(.8); 42 42 this->sphereMaterial->setDiffuse(r, g, b); 43 43 this->toList(OM_COMMON); … … 53 53 { 54 54 WorldEntity::loadParams(root); 55 LoadParam(root, "respawnType", this, PowerUp, setRespawnType); 56 LoadParam(root, "respawnTime", this, PowerUp, setRespawnTime); 55 57 } 56 58 … … 62 64 if(dynamic_cast<Extendable*>(entity)->pickup(this)) 63 65 { 64 this->respawnTime = this->respawnStart; 65 this->toList(OM_DEAD_TICK); 66 switch(respawnType) { 67 case RESPAWN_NONE: 68 this->toList(OM_DEAD); 69 break; 70 case RESPAWN_TIME: 71 this->toList(OM_DEAD_TICK); 72 this->respawnTime = this->respawnStart; 73 break; 74 } 66 75 } 67 76 } … … 72 81 this->respawnTime -= dt; 73 82 if(this->respawnTime <= 0) { 74 this->respawn();75 83 this->toList(OM_COMMON); 76 84 } … … 110 118 } 111 119 120 void PowerUp::setRespawnTime(const float respawnTime) 121 { 122 this->respawnStart = respawnTime; 123 } 112 124 113 125
Note: See TracChangeset
for help on using the changeset viewer.