Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2005, 3:00:24 PM (18 years ago)
Author:
manuel
Message:

declared extendable

File:
1 edited

Legend:

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

    r5439 r5871  
    1818
    1919#include "power_up.h"
     20#include "extendable.h"
    2021
    2122
     
    2425
    2526
    26 PowerUp::PowerUp ()
     27PowerUp::PowerUp (PowerUpType type)
    2728{
    28   this->setClassID(CL_POWER_UP, "PowerUp");
    29 
     29  this->init();
    3030}
    3131
     32PowerUp::PowerUp(const TiXmlElement* root)
     33{
     34  this->init();
     35  this->loadParams(root);
     36}
    3237
     38void PowerUp::init() {
     39  this->setClassID(CL_POWER_UP, "PowerUp");
     40  this->type = type;
     41}
    3342
    3443PowerUp::~PowerUp () {}
    3544
    3645
    37 void PowerUp::loadParam(const TiXmlElement* root)
     46void PowerUp::loadParams(const TiXmlElement* root)
    3847{
    3948  static_cast<WorldEntity*>(this)->loadParams(root);
    40 
    4149}
    4250
     51
     52void PowerUp::collidesWith (WorldEntity* entity, const Vector& location)
     53{
     54 if(entity->isA(CL_EXTENDABLE))
     55  {
     56    if(dynamic_cast<Extendable*>(entity)->pickup(this))
     57    {
     58      this->setVisibiliy(false);
     59    }
     60  }
     61}
Note: See TracChangeset for help on using the changeset viewer.