Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6084 in orxonox.OLD


Ignore:
Timestamp:
Dec 13, 2005, 11:40:03 AM (18 years ago)
Author:
patrick
Message:

network: spawning point coded, not yet tested

Location:
branches/network/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/world_entities/spawning_point.cc

    r6083 r6084  
    2323 */
    2424SpawningPoint::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}
    2632
    2733
     
    3743  this->classID = classID;
    3844  this->world = world;
     45  this->countDown = 0.0f;
    3946}
    4047
     
    6067
    6168
    62 
    6369/**
    6470 *  this method is called every frame
     
    6874 */
    6975void 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}
    7184
    7285
  • branches/network/src/world_entities/spawning_point.h

    r6083 r6084  
    3838  private:
    3939    float                frequency;                      //!< the frequency for entity spawning
     40    float                countDown;                      //!< the timer that counts down until the next spawn
    4041    float                seed;                           //!< the random seed of the position
    4142    int                  classID;                        //!< the classid of the entity to spawn
     43
    4244
    4345};
Note: See TracChangeset for help on using the changeset viewer.