Phase II — Progress Report — Magnet
Who knew that powerups were magnetic! In this quick update, I will discuss the new feature “Magnets”
The new feature allows the player to engage the magnets on their ship to lock on to the magnetic field of the power-ups and cause them to change their direction and move towards the player.
This is achieved through an event that is heard by the powerups. The powerups hear the event and set their “magnetIsActive” bool to true.
In the movement script I have made a logic check that will see if the magnets are active, and if so, move towards the player’s position. If the player event is heard saying the magnets are inactive the powerup continues to move as normal.
The player has a limited charge for the magnets utilizing the same functionality as the hyperdrive feature (updating image masks on-screen with charge level for example).
All we need to do now is test the function.