Пример #1
0
void cRokko::Update_Normal_Dying(void)
{
    if (m_vely < m_gravity_max) {
        Add_Velocity_Y_Max(1.5f, m_gravity_max);
    }

    if (m_dying_counter >= 5.0f && m_curr_img < 3)
        Set_Image_Num(3);
    else if (m_dying_counter >= 10.0f && m_curr_img == 3)
        Set_Image_Num(4);
    else if (m_dying_counter >= 15.0f && m_curr_img == 4)
        Set_Image_Num(5);

    Move(m_velx, m_vely);

    if (m_rot_z - m_start_rot_z < 90) {
        Add_Rotation_Z(pFramerate->m_speed_factor);
    }

    // generate smoke
    m_smoke_counter += pFramerate->m_speed_factor * 4;
    if (m_smoke_counter >= 2.0f) {
        Generate_Smoke(static_cast<int>(m_smoke_counter));
        Generate_Sparks(static_cast<int>(m_smoke_counter * 0.5f));
        m_smoke_counter -= static_cast<int>(m_smoke_counter);
    }

    // below ground
    if (m_col_rect.m_y - 200.0f > pActive_Camera->m_limit_rect.m_y + game_res_h) {
        m_rot_z = 0.0f;
        m_massive_type = MASS_PASSIVE;
        Set_Active(0);
        m_velx = 0.0f;
    }
}
Пример #2
0
void cRokko :: Update_Dying( void )
{
	// add gravity
	if( m_vely < 25 )
	{
		Add_Velocity( 0, 1.5f );
	}

	Move( m_velx, m_vely );

	if( m_rot_z - m_start_rot_z < 90 )
	{
		Add_Rotation_Z( pFramerate->m_speed_factor );
	}

	// generate smoke
	m_smoke_counter += pFramerate->m_speed_factor * 4;
	if( m_smoke_counter >= 2 )
	{
		Generate_Smoke( static_cast<int>(m_smoke_counter) );
		Generate_Sparks( static_cast<int>(m_smoke_counter * 0.5f) );
		m_smoke_counter -= static_cast<int>(m_smoke_counter);
	}

	// below ground
	if( m_col_rect.m_y - 200.0f > pActive_Camera->limit_rect.m_y + game_res_h )
	{
		m_rot_z = 0.0f;
		m_massive_type = MASS_PASSIVE;
		Set_Active( 0 );
		m_velx = 0.0f;
	}
}