Powerup

Powerups give actors new powers or bonuses.

Public Methods

public virtual void RemoveEffect(RexActor actor)

If the powerup is temporary, calling this will remove its effect from the actor passed in. This can be overridden by specific powerups to determine what happens when the effect is removed.

public void RemoveFromAllAffected()

If the powerup is temporary, this removes its effect from every single actor it has affected.

Public Members

public Sounds sounds

This lets you slot a sound to play when the powerup is collected.

public bool willDestroyOnCollision = true

This determines whether the powerup object is destroyed when it collides with an actor that uses it.

public bool canBeCollectedByEnemies

This determines whether actors with the “Enemy” tag can collect this powerup.

public RexParticle collectParticle

This allows you to slot a particle to play when the powerup is collected.

public StackType stackType

StackType gives you two options: OverwriteOld or IgnoreNew. This setting comes into play if an actor touches two powerups of the same type before the first one has worn off. If the stack type is set to OverwriteOld, the effect of the second powerup touched will overwrite the effect of the previous one. If the stack type is set to IgnoreNew, the effect of the second powerup touched will be ignored.

public AffectType affect

AffectType governs what actors will be affected when this powerup is collected. CollidingActor means the powerup will affect the actor that touched it. OnscreenEnemies means it will affect all onscreen actors with the “Enemy” tag. AllEnemies means it will affect all actor in the current scene with the “Enemy” tag.