Power Ups

Power Ups are a special type of item which grant your character new powers. Power-ups may last for a time-limit, or alternatively last until a level is complete (or the character dies).

Power Ups are created in the same ways as Items but instead of requiring an ItemManager they require a PowerUpResponder. The PowerUpResponder defines what happens when you collect a power-up.


Power Up Manager

The PowerUpManager component needs to be added to your Character in order for Power Ups to have an effect on the Character.

The PowerUpResponder defines a list of power ups and the actions that need to be taken to enable the power. It also defines the reset actions: those things that need to be done to undo or reset a power up.

Defining a Power Up

 

See Creating Items to create a power-up.

Power Up Actions

Each power up type (as defined in the Item Type Editor) will be shown in the PowerUpManager and each can have one or more actions that implement the power up behaviour. To add an action click the Add Action button.

Power up actions are identical to event responses, see Event Responders for full details.

To remove an action click the Remove Action button.

Note: Some power up actions can be defined directly in the Item Type Editor when creating the Power Up, for exmaple making a character Invulnerable.

Defining Reset Actions

A reset action is exactly like a power up except that it defines actions that undo the actions of the power up. i.e. what happens when the power up expires.

A section for adding reset actions will be automatically shown for each PowerUp with a timer, or which resets on damage.

As an example the following PowerUp is called SuperPunch and enables a GameObject which might contain a particle effect, movement, etc. The reset action deactivates the GameObject.

mceclip0.png

Help... my power-ups aren't showin in my inspector! If your power-ups don't showin you in your PowerUpManager Inspector save your scene, open another scene, then re-open your original scene.

Power-Up Active Condition

One of the most common power up actions is to enable or disable a set of movements.

Rather than setting up enable/disable actions in the PowerUpManager you can use the PowerUpActiveCondition instead. Simply add this condition to the same GameObject(s) as the movement(s) you want to enable/disable and type the power-up name in the slot provided. No reset is required.

Master Reset Actions 

The master Reset Actions shown at the top of the PowerUpManagaer are used to reset your Character after death. If your Character is set up so that the you do not RELOAD_SCENE after death then you need to ensure your master reset has all the actions required to reset any and all power-ups.

For example if you have one power-up that makes your character invulnerable, and another which changes the animation override, and another which enables an ability, then the master reset should undo all three actions (i.e. make vulnerable, reset the animation override, disable the ability).

  

 

 



Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk