Changeset 6084 in orxonox.OLD for branches/network
- Timestamp:
- Dec 13, 2005, 11:40:03 AM (19 years ago)
- Location:
- branches/network/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/world_entities/spawning_point.cc
r6083 r6084 23 23 */ 24 24 SpawningPoint::SpawningPoint (const Vector& absCoordinate, const World* world) 25 {} 25 : WorldEntity(absCoodrinate) 26 { 27 this->world = world; 28 this->frequency = 0.5f; 29 this->seed = 0.0f; 30 this->countDown = 0.0f; 31 } 26 32 27 33 … … 37 43 this->classID = classID; 38 44 this->world = world; 45 this->countDown = 0.0f; 39 46 } 40 47 … … 60 67 61 68 62 63 69 /** 64 70 * this method is called every frame … … 68 74 */ 69 75 void SpawningPoint::tick(float dt) 70 {} 76 { 77 this->countDown += dt; 78 if( this->countDown > this->frequency) 79 { 80 this->spawn(); 81 this->countDown = 0.0f; 82 } 83 } 71 84 72 85 -
branches/network/src/world_entities/spawning_point.h
r6083 r6084 38 38 private: 39 39 float frequency; //!< the frequency for entity spawning 40 float countDown; //!< the timer that counts down until the next spawn 40 41 float seed; //!< the random seed of the position 41 42 int classID; //!< the classid of the entity to spawn 43 42 44 43 45 };
Note: See TracChangeset
for help on using the changeset viewer.