Esempio n. 1
0
Bomb::Image::Image(int posX, int posY, int width, int height, std::string name, std::string path)
{

  this->ctor(Image_o);

  PositionComponent	*pos = new PositionComponent();
  pos->AssignEntity(this);
  this->AddComponent(pos);

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


  this->posX = posX;
  this->posY = posY;
  this->width = width;
  this->height = height;
  this->path = path;
  this->name = name;

  MeshComponent           *graphic =
    new MeshComponent(GEOMETRY,
		      new std::string(this->name),
		      new std::string(this->path),
		      ImageMeshInit,
		      ImageMeshDraw,
		      G_Renderer);
  graphic->AssignEntity(this);
  this->AddComponent(graphic);
}
Esempio n. 2
0
Bomb::DefaultBomb::DefaultBomb()
{
  this->ctor(DefaultBomb_o);

  PositionComponent	*position = new PositionComponent();
  position->AssignEntity(this);
  this->AddComponent(position);
  this->_isDestroy = true;
}
Esempio n. 3
0
Bomb::DestructibleBox::DestructibleBox()
{
	this->ctor(DestructibleBox_o);

	PositionComponent	*pos = new PositionComponent();
	pos->AssignEntity(this);
	this->AddComponent(pos);

	LifeComponent		*life = new LifeComponent(1);
	life->AssignEntity(this);
	this->AddComponent(life);

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


  DropBonusComponent   *dropBonus = new DropBonusComponent();
  dropBonus->AssignEntity(this);
  this->AddComponent(dropBonus);

	MeshComponent		*graphic =
	  new MeshComponent(GEOMETRY,
			    new std::string("box2"),
			    new std::string(MODELPATH"box2.tga"),
			    DestructibleBoxMeshInit,
			    DestructibleBoxMeshDraw,
			    G_Renderer);
	graphic->AssignEntity(this);
	this->AddComponent(graphic);

  this->_isDestroy = true;

	/*AudioComponent		*audio = new AudioComponent();
	audio->AssignEntity(this);
	this->AddComponent(audio);*/
}