void cStaticEnemy :: Update_Dying( void ) { m_counter += pFramerate->m_speed_factor * 0.1f; // falling death // a little bit upwards first if( m_counter < 0.3f ) { Move( 0.0f, -5.0f ); } // if not below the screen fall else if( m_pos_y < game_res_h + m_col_rect.m_h ) { Move( 0.0f, 20.0f ); Add_Scale( -pFramerate->m_speed_factor * 0.01f ); } // if below disable else { m_rot_z = 0.0f; Set_Scale( 1.0f ); Set_Active( 0 ); } }
void cSpikeball :: Update_Dying( void ) { // stomp death if( !Is_Float_Equal( m_rot_z, 180.0f ) ) { // scale out float speed = pFramerate->m_speed_factor * 0.05f; Add_Scale_X( -speed * 0.5f ); Add_Scale_Y( -speed ); if( m_scale_y < 0.01f ) { Set_Scale( 1.0f ); Set_Active( 0 ); } } // falling death else { m_counter += pFramerate->m_speed_factor * 0.1f; // a little bit upwards first if( m_counter < 0.3f ) { Move( 0.0f, -5.0f ); } // if not below the ground : fall else if( m_col_rect.m_y < pActive_Camera->m_limit_rect.m_y ) { Move( 0.0f, 20.0f ); Add_Scale( -pFramerate->m_speed_factor * 0.01f ); } // if below disable else { m_rot_z = 0.0f; Set_Scale( 1.0f ); Set_Active( 0 ); } } }
void cMenu_Item :: Set_Active( bool nactive /* = 0 */ ) { active = nactive; m_rot_z = 0; Set_Scale( 1 ); if( !nactive ) { Set_Color_Combine( 0, 0, 0, 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); } } }
void cStaticEnemy::Update_Dying(void) { m_counter += pFramerate->m_speed_factor * 0.1f; if (m_counter < 0.3f) { Move(0.0f, -5.0f); } else if (m_pos_y < game_res_h + m_col_rect.m_h) { Move(0.0f, 20.0f); Add_Scale(-pFramerate->m_speed_factor * 0.01f); } else { m_rot_z = 0.0f; Set_Scale(1.0f); Set_Active(0); } }