Exemple #1
0
void cRokko::Update(void)
{
    cEnemy::Update();

    if (!m_valid_update || !Is_In_Range())
        return;

    // if not active
    if (m_state != STA_FLY) {
        // Do not self-activate when manual triggering is enabled
        if (m_manual)
            return;
        // Do not activate if Maryo is a ghost
        else if (pLevel_Player->m_maryo_type == MARYO_GHOST)
            return;
        // if player is in front then activate
        else if (pLevel_Player->m_col_rect.Intersects(Get_Final_Distance_Rect()))
            Activate();
        // Do not activate if Maryo is not near by
        else
            return;
    }

    Update_Animation();

    // generate smoke
    m_smoke_counter += pFramerate->m_speed_factor * 4.0f;
    if (m_smoke_counter >= 1.0f) {
        Generate_Smoke(static_cast<int>(m_smoke_counter));
        m_smoke_counter -= static_cast<int>(m_smoke_counter);
    }
}
Exemple #2
0
void cRokko :: Update( void )
{
	cEnemy::Update();

	if( !m_valid_update || !Is_In_Player_Range() )
	{
		return;
	}

	// if not active
	if( m_state != STA_FLY )
	{
		GL_rect final_distance = Get_Final_Distance_Rect();

		// if player is in front then activate
		if( pPlayer->maryo_type != MARYO_GHOST && pPlayer->m_col_rect.Intersects( final_distance ) )
		{
			Activate();
		}
		else
		{
			return;
		}
	}

	// generate smoke
	m_smoke_counter += pFramerate->m_speed_factor * 4.0f;
	if( m_smoke_counter >= 1.0f )
	{
		Generate_Smoke( static_cast<int>(m_smoke_counter) );
		m_smoke_counter -= static_cast<int>(m_smoke_counter);
	}
}
Exemple #3
0
void cRokko :: Draw( cSurface_Request *request /* = NULL */ )
{
	if( !m_valid_draw )
	{
		return;
	}

	// draw distance rect
	if( editor_level_enabled )
	{
		GL_rect final_distance = Get_Final_Distance_Rect();
		final_distance.m_x -= pActive_Camera->x;
		final_distance.m_y -= pActive_Camera->y;

		pVideo->Draw_Rect( &final_distance, m_pos_z - 0.00001f, &whitealpha128 );
	}

	bool create_request = 0;

	if( !request )
	{
		create_request = 1;
		// create request
		request = new cSurface_Request();
	}

	// Draw
	cEnemy::Draw( request );

	// alpha in debug mode
	if( editor_level_enabled )
	{
		request->color.alpha = 64;
	}

	if( create_request )
	{
		// add request
		pRenderer->Add( request );
	}
}