Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2005, 3:15:54 PM (18 years ago)
Author:
manuel
Message:

implemented param_power_up.
started some powerup respawn possibilities
powerups don't display yet!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/powerups/src/world_entities/power_ups/power_up.cc

    r6040 r6107  
    5050    if(dynamic_cast<Extendable*>(entity)->pickup(this))
    5151    {
    52       this->hide();
     52      this->setVisibiliy(false);
    5353    }
    5454  }
    5555}
    5656
    57 void PowerUp::hide()
     57void PowerUp::draw() const
    5858{
    59   this->setVisibiliy(false);
     59  WorldEntity::draw();
     60
     61  glMatrixMode(GL_MODELVIEW);
     62  glPushMatrix();
     63  float matrix[4][4];
     64
     65  /* translate */
     66  glTranslatef (this->getAbsCoor ().x,
     67                this->getAbsCoor ().y,
     68                this->getAbsCoor ().z);
     69  /* rotate */ // FIXME: devise a new Way to rotate this
     70  this->getAbsDir ().matrix (matrix);
     71  glMultMatrixf((float*)matrix);
     72
     73  this->sphereMaterial->select();
     74  sphereModel->draw();
     75
     76  glPopMatrix();
    6077}
    6178
    62 void PowerUp::draw()
     79const char* PowerUp::respawnTypes[] = {
     80  "none",
     81  "time"
     82};
     83
     84void PowerUp::setRespawnType(const char* type)
    6385{
    64   WorldEntity::draw();
    65   this->sphereMaterial->select();
    66   sphereModel->draw();
     86  for(int i = 0; i < RESPAWN_size; ++i) {
     87    if(strcmp(type, respawnTypes[i]) == 0) {
     88      this->respawnType = (PowerUpRespawn)i;
     89      break;
     90    }
     91  }
    6792}
    6893
Note: See TracChangeset for help on using the changeset viewer.