Example #1
0
 void cBaseBox::Activate_Collision(ObjectDirection cdirection)
 {
     if (move_col_dir != DIR_UNDEFINED)
     {
         return;
     }
     
     if (useable_count == 0)
     {
         return;
     }
     
     if (box_invisible)
     {
         if (box_invisible == BOX_INVISIBLE_SEMI_MASSIVE)
         {
             m_massive_type = MASS_MASSIVE;
         }
     }
     
     if (cdirection == DIR_UP)
     {
         Set_Scale_Directions(1, 0, 1, 1);
     }
     else if (cdirection == DIR_DOWN)
     {
         Set_Scale_Directions(0, 1, 1, 1);
     }
     else if (cdirection == DIR_LEFT)
     {
         Set_Scale_Directions(1, 0, 1, 0);
     }
     else if (cdirection == DIR_RIGHT)
     {
         Set_Scale_Directions(1, 0, 0, 1);
     }
     
     move_col_dir = cdirection;
     Update_Valid_Update();
     
     Check_Collision(Get_Opposite_Direction(move_col_dir));
     Activate();
     
     if (useable_count > 0 || useable_count == -1)
     {
         Set_Useable_Count(useable_count - 1);
     }
 }
Example #2
0
cMenu_Item :: cMenu_Item( void )
: cHudSprite()
{
	Set_Scale_Directions( 1, 1, 1, 1 );
	active = 0;
	isquit = 0;

	image_default = new cHudSprite();
	image_menu = new cHudSprite();
}
Example #3
0
 void cStaticEnemy::DownGrade(bool force)
 {
     Set_Dead(1);
     m_massive_type = MASS_PASSIVE;
     m_counter = 0.0f;
     m_velx = 0.0f;
     m_vely = 0.0f;
     Set_Scale_Directions(1, 1, 1, 1);
     
     Set_Rotation_Z(180.0f);
 }
Example #4
0
 void cBaseBox::Update_Collision(void)
 {
     if (move_col_dir == DIR_UNDEFINED)
     {
         return;
     }
     
     if (move_col_dir != DIR_UP && move_col_dir != DIR_DOWN && move_col_dir != DIR_RIGHT && move_col_dir != DIR_LEFT)
     {
         printf("Warning : wrong box collision direction %d\n", move_col_dir);
         move_col_dir = DIR_UNDEFINED;
         Update_Valid_Update();
         return;
     }
     
     float mod = pFramerate->m_speed_factor * 0.05f;
     
     move_counter += pFramerate->m_speed_factor * 0.2f;
     
     if (!move_back)
     {
         Add_Scale(mod);
         
         Generate_Activation_Particles();
         
         if (move_counter > 1.0f)
         {
             move_back = 1;
             move_counter = 0.0f;
         }
     }
     else
     {
         Add_Scale(-mod);
         
         if (move_counter > 1.0f)
         {
             move_col_dir = DIR_UNDEFINED;
             Update_Valid_Update();
             move_back = 0;
             move_counter = 0.0f;
             
             m_col_pos = m_image->m_col_pos;
             
             Set_Scale(1);
             Set_Scale_Directions(1, 1, 1, 1);
             
             Set_Pos(m_start_pos_x, m_start_pos_y);
         }
     }
 }
Example #5
0
void cSpikeball :: DownGrade( bool force /* = 0 */ )
{
	Set_Dead( 1 );
	m_massive_type = MASS_PASSIVE;
	m_counter = 0.0f;
	m_velx = 0.0f;
	m_vely = 0.0f;
	// dead image
	Set_Image_Num( 9 );
	Set_Animation( 0 );

	// default stomp death
	if( !force )
	{
		Generate_Hit_Animation();
		Set_Scale_Directions( 1, 0, 1, 1 );
	}
	// falling death
	else
	{
		Set_Rotation_Z( 180 );
		Set_Scale_Directions( 1, 1, 1, 1 );
	}
}
Example #6
0
 cBaseBox::cBaseBox(float x, float y)
 : cAnimated_Sprite(x, y)
 {
     m_type = TYPE_ACTIVESPRITE;
     m_sprite_array = ARRAY_ACTIVE;
     m_massive_type = MASS_MASSIVE;
     m_can_be_ground = 1;
     Set_Scale_Directions(1, 1, 1, 1);
     
     box_type = TYPE_UNDEFINED;
     item_image = NULL;
     m_pos_z = 0.055f;
     
     move_col_dir = DIR_UNDEFINED;
     move_counter = 0.0f;
     move_back = 0;
     
     useable_count = 1;
     start_useable_count = 1;
     
     box_invisible = BOX_VISIBLE;
     
     particle_counter_active = 0.0f;
 }