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.
Note: Power-ups are not permanent. A future version will contain Upgrades which are more permanent variation of power-ups (last between levels, last between lives or even last between games). Let us know if you want this feature prioritised.
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
Click the Add Power Up Type button to add a power up. A new power up type with an empty name will be added to the list. Expanding the empty item will show the following fields:
|Power Up Type||Name of the power up. Must match the item type exactly.|
|Power Up Timer||If the power up expires after a time then this is the time in seconds that the power up will last for.|
|Reset Response||Only shown if Power Up Timer is non zero. This is the 'reset' power up that will be used to reset the character back to their default state when the timer expires.|
To remove a power up click the Remove Power Up Type button.
Power Up Actions
Each power up type should 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 Responder for full details.
As an example the following PowerUp is called SuperPunch and enables a BasicAttack behaviour:
To remove an action click the Remove Action button.
Defining a Reset
A reset is exactly like any other power up except that it defines actions that undo the actions of another power up. Resets are required for any timer based power up.
Here the example of the SuperPunch is extended to include a 20 second timer and a reset which disables the SuperPunch:
The Master Reset (RESET)
The Power up called RESET is known as the master reset. It is used to reset your Character after death. If your Character 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).
Note: You should generally use ENABLE_BEHAVIOUR not ACTIVATE_GAMEOBJECT when creating movement based power-ups. To disable the movement on start-up make sure you have a corresponding DISABLE_BEHAVIOUR in the master reset action list.
Power-Up Active Condition
From v1.1.5 you should use the PowerUpActiveCondition instead of enabling movements for power-ups which activate new movements. Simply add this condition to the same GameObject as the movement you want to enable/disable and type the power-up name in the slot provided. No reset is required.