Exemplo n.º 1
0
void		Character::explose(int i, int y, int posx, int posy, int power)
{
  if (power >= 0)
    {
      if (y == 0)
	{
	  if (explose2(posx, posy) == 1)
	    {
	      this->map->setPos(42, posx, posy);
	      explose(i, y, posx + i, posy, power -1);
	    }
	  else
	    return;
	}
      if (y == 1)
	{
	  if (explose2(posx, posy) == 1)
	    {
	      this->map->setPos(42, posx, posy);
	      explose(i, y, posx, posy + i, power -1);
	    }
	  else
	    return;
	}
    }
}
Exemplo n.º 2
0
void ChimicBlok::collidesWithItem(KGLPhysicsItem * item)
{

    if ( item->objectName()=="CHIMIC_BLOCK")
    {
        explose(5,3);
        setRemove(true);
    }

}
Exemplo n.º 3
0
void check_bombe(tableau tbombe, tableau tjeu){
  int i,j;
  for (i=0;i<tbombe.hauteur;i=i+1){ /* Incrémentation de 1 de tous les éléments du tableau de bombes car on considère le round fini */
    for (j=0;j<tbombe.largeur;j=j+1){
      if (tbombe.t[i][j]!=0){
	tbombe.t[i][j]=tbombe.t[i][j]+1;
      }
      if (tbombe.t[i][j]==8){ /* Explosion si un compteur est à 8 car au bout de 8 rounds les bombes explosent automatiquement */
	explose(tjeu.t[i][j], tjeu, i, j);
	tbombe.t[i][j]=0;
      }
    }
  }
}
Exemplo n.º 4
0
/**
 * \brief Process a collision with hot air balloon.
 * \param that The other item of the collision.
 * \return Return True if the collision is with a hot air balloon.
 */
bool rp::tnt::collision_with_zeppelin( bear::engine::base_item& that )
{ 
  bool result = false;
  zeppelin* z = dynamic_cast<zeppelin*>(&that);
  
  if ( z != NULL ) 
    {
      update_combo_value(z);      
      explose();
      
      result = true;
    }
  
  return result;
} // tnt::collision_with_zeppelin()
Exemplo n.º 5
0
/**
 * \brief Process a collision with a cart.
 * \param that The other item of the collision.
 * \return Return True if the collision is with a cart.
 */
bool rp::tnt::collision_with_cart( bear::engine::base_item& that )
{ 
  bool result = false;
  cart* c = dynamic_cast<cart*>(&that);
  
  if ( c != NULL ) 
    {
      set_combo_value(0);          
      explose(false);
      
      result = true;
    }
  
  return result;
} // tnt::collision_with_cart()
Exemplo n.º 6
0
/**
 * \brief Process a collision with a cannonbal.
 * \param that The other item of the collision.
 * \return Return True if the collision is with a bird.
 */
bool rp::tnt::collision_with_bird
( bear::engine::base_item& that )
{ 
  bool result = false;
  bird* b = dynamic_cast<bird*>(&that);
  
  if ( b != NULL ) 
    {
      update_combo_value(b);      
      explose();
          
      result = true;
    }
  
  return result;
} // tnt::collision_with_bird()
Exemplo n.º 7
0
/**
 * \brief Process a collision with a plank.
 * \param that The other item of the collision.
 * \return Return True if the collision is with a plank.
 */
bool rp::tnt::collision_with_plank
( bear::engine::base_item& that )
{ 
  bool result = false;
  plank* p = dynamic_cast<plank*>(&that);
  
  if ( p != NULL ) 
    {
      if ( p->get_combo_value() != 0 )
        set_combo_value(p->get_combo_value()+1);      
      explose();
        
      result = true;
    }
  
  return result;
} // tnt::collision_with_plank()
Exemplo n.º 8
0
/**
 * \brief Process a collision with a obstacle.
 * \param that The other item of the collision.
 * \return Return True if the collision is with a obstacle.
 */
bool rp::tnt::collision_with_obstacle
( bear::engine::base_item& that )
{ 
  bool result = false;
  obstacle* o = dynamic_cast<obstacle*>(&that);
  
  if ( o != NULL ) 
    {
      if ( o->get_speed().length() > 200 )
        {
          update_combo_value(o);      
          explose();
          result = true;
        }
    }
  
  return result;
} // tnt::collision_with_obstacle()
Exemplo n.º 9
0
/**
 * \brief Process a collision with a cannonbal.
 * \param that The other item of the collision.
 * \return Return True if the collision is with a cannonball.
 */
bool rp::tnt::collision_with_cannonball
( bear::engine::base_item& that )
{ 
  bool result = false;
  cannonball* c = dynamic_cast<cannonball*>(&that);
  
  if ( c != NULL ) 
    {
      set_combo_value( c->get_combo_value() );      
      
      if ( ! m_explosed )
        c->kill();

      explose();
      result = true;
    }
  
  return result;
} // tnt::collision_with_cannonball()
Exemplo n.º 10
0
/**
 * \brief Process a collision with a bomb.
 * \param that The other item of the collision.
 * \return Return True if the collision is with a bomb.
 */
bool rp::tnt::collision_with_bomb
( bear::engine::base_item& that )
{ 
  bool result = false;
  bomb* b = dynamic_cast<bomb*>(&that);
  
  if ( b != NULL ) 
    {
      if ( ! m_explosed && ! b->is_explosed() )
        {
          update_combo_value(b);      
          explose();
          b->explose();
        }

      result = true;
    }
  
  return result;
} // tnt::collision_with_bomb()
Exemplo n.º 11
0
/**
 * \brief Process a collision with an explosion.
 * \param that The other item of the collision.
 * \param info Some informations about the collision.
 * \return Return True if the collision is with a cart.
 */
bool rp::tnt::collision_with_explosion
( bear::engine::base_item& that, bear::universe::collision_info& info )
{ 
  bool result = false;
  explosion* e = dynamic_cast<explosion*>(&that);
  
  if ( e != NULL ) 
    {
      if ( e->test_in_explosion(info) ) 
        {
          if ( e->get_combo_value() != 0 )
            set_combo_value(e->get_combo_value()+1);      
          explose();
        }

      result = true;
    }
  
  return result;
} // tnt::collision_with_explosion()