Changeset 10643 in orxonox.OLD for trunk/src/world_entities/npcs/mover.cc
- Timestamp:
- Apr 29, 2007, 6:51:28 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npcs/mover.cc
r10618 r10643 82 82 .describe("sets the action time of the door") 83 83 .defaultValues(1.0); 84 LoadParam(root, "stay-open-time", this, Mover, setStayOpenTime) 85 .describe("sets the time, the door must stay open") 86 .defaultValues(0.0); 84 87 LoadParam(root, "opening-sound", this, Mover, setOpeningSoundFile) 85 88 .describe("Sets the file of the opening sound source"); … … 146 149 this->soundSource_moving.stop(); 147 150 } 151 this->openTime = 0; 148 152 } 149 153 else if (this->state == Open) 150 154 { 151 if (!this->checkPlayerInActionRadius()) 152 { 153 this->state = Closing; 154 if (this->soundBuffer_closing.loaded()) 155 this->soundSource_starting.play(this->soundBuffer_closing); 156 if (this->soundBuffer_moving.loaded()) 157 this->soundSource_moving.play(this->soundBuffer_moving, 1.0, true); 155 this->openTime += dt; 156 if (this->openTime >= this->stayOpenTime) 157 { 158 if (!this->checkPlayerInActionRadius()) 159 { 160 this->state = Closing; 161 if (this->soundBuffer_closing.loaded()) 162 this->soundSource_starting.play(this->soundBuffer_closing); 163 if (this->soundBuffer_moving.loaded()) 164 this->soundSource_moving.play(this->soundBuffer_moving, 1.0, true); 165 } 158 166 } 159 167 }
Note: See TracChangeset
for help on using the changeset viewer.