//----------------------------------------------------------------------------- // Purpose: // Input : pParticle - //----------------------------------------------------------------------------- void CParticleEffect::NotifyDestroyParticle( Particle* pParticle ) { // Go away if we're released and there are no more particles. if( m_ParticleEffect.GetNumActiveParticles() == 0 && IsReleased() && (m_Flags & FLAG_ALLOCATED) && !(m_Flags & FLAG_DONT_REMOVE) ) { m_ParticleEffect.SetRemoveFlag(); } }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CParticleEffect::NotifyRemove() { if( m_Flags & FLAG_ALLOCATED ) { Assert( IsReleased() ); delete this; } }
//----------------------------------------------------------------------------- // Purpose: // Input : pParticle - //----------------------------------------------------------------------------- void CParticleEffect::NotifyDestroyParticle( Particle* pParticle ) { // Go away if we're released and there are no more particles. if( m_ParticleEffect.GetNumActiveParticles() == 0 && IsReleased() ) { m_ParticleEffect.SetRemoveFlag(); } }
void KeyHandler::GiveInstructions(Player *player) { if (IsPressed(SDLK_SPACE)) { (*player).AttemptJump(); //std::cout << "space pressed" << std::endl; } if (IsPressed(SDLK_a) && IsPressed(SDLK_d)) // both a and d pressed (*player).StopSprite(); else if (IsPressed(SDLK_a)) // only a (left) pressed (*player).MoveSprite('L'); else if (IsPressed(SDLK_d)) // only d (right) pressed (*player).MoveSprite('R'); else if (IsReleased(SDLK_a) && IsReleased(SDLK_d)) // both released (*player).StopSprite(); }