SuperTuxKart
Public Member Functions | Private Attributes | List of all members
HitEffect Class Referenceabstract

A small interface for effects to be used when a kart is hit. More...

#include <hit_effect.hpp>

Inheritance diagram for HitEffect:
Inheritance graph
[legend]

Public Member Functions

 HitEffect ()
 Constructor for a hit effect. More...
 
virtual bool updateAndDelete (int ticks)=0
 Updates a hit effect. More...
 
virtual void setLocalPlayerKartHit ()
 Sets that this SFX affects a player kart, which can be used to make certain sfx louder/less loud. More...
 
bool getLocalPlayerKartHit () const
 Returns if this effect affects a player kart. More...
 

Private Attributes

bool m_local_player_kart_hit
 True if this effect affected a player kart. More...
 

Detailed Description

A small interface for effects to be used when a kart is hit.

That includes a sound effect only, or a graphical effect (like an explosion).

Constructor & Destructor Documentation

◆ HitEffect()

HitEffect::HitEffect ( )
inline

Constructor for a hit effect.

Member Function Documentation

◆ getLocalPlayerKartHit()

bool HitEffect::getLocalPlayerKartHit ( ) const
inline

Returns if this effect affects a player kart.

◆ setLocalPlayerKartHit()

virtual void HitEffect::setLocalPlayerKartHit ( )
inlinevirtual

Sets that this SFX affects a player kart, which can be used to make certain sfx louder/less loud.

Default is that the affect does not affect a player kart.

Reimplemented in HitSFX.

◆ updateAndDelete()

virtual bool HitEffect::updateAndDelete ( int  ticks)
pure virtual

Updates a hit effect.

Called once per frame.

Parameters
dtTime step size.
Returns
True if the hit effect is finished and can be removed.

Implemented in Explosion, and HitSFX.

Member Data Documentation

◆ m_local_player_kart_hit

bool HitEffect::m_local_player_kart_hit
private

True if this effect affected a player kart.

Used to play certain SFX less loud if only an AI is hit.


The documentation for this class was generated from the following file: