Beispiel #1
0
Bomb::NormalBomb::NormalBomb()
{
  this->ctor(NormalBomb_o);

  TimerComponent	*timer = new TimerComponent(NORMAL_BOMB_TIMER);
  timer->AssignEntity(this);
  this->AddComponent(timer);

  PhysicComponent   *physic = new PhysicComponent(0.5);
  physic->AssignEntity(this);
  this->AddComponent(physic);

  MeshComponent           *graphic =
    new MeshComponent(MODEL,
		      new std::string("bombe"),
		      new std::string(MODELPATH"bombe/bombe.fbx"),
		      BombMeshInit,
		      BombMeshDraw,
		      G_Renderer);
  graphic->AssignEntity(this);
  this->AddComponent(graphic);

  ExplodeComponent	*explode = new ExplodeComponent(NORMAL_BOMB_POWER, NORMAL_BOMB_SIZE);
  explode->AssignEntity(this);
  this->AddComponent(explode);
  this->_isDestroy = true;

  //	AudioComponent
  AudioComponent*	audio = new AudioComponent(Event::COMMON);
  audio->AssignEntity(this);
  this->AddComponent(audio);
  _sound = new std::string("explosion");
  _soundpath = new std::string(SOUNDPATH"BOMB_01.wav");
  audio->AddSound(_soundpath, _sound);
}
Beispiel #2
0
Bomb::ClassicMode::ClassicMode()
{
  this->ctor(ClassicMode_o);
  this->_isDestroy = false;

  TimerComponent	*timer = new TimerComponent(180);
  timer->AssignEntity(this);
  this->AddComponent(timer);
}