#3.1 Upgrades: Powerups




Besides the normal lootboxes that contain a battery, there are also those that provide the player with an upgrade.


They work on the same principle. If the player jumps against it from below, the actor is hidden and its sprite changes to reappear in the form of an upgrade above it. Which upgrade this is depends on the player's current upgrade level. The growth upgrade lets the player ... grow. Who would have thought? It gives the player a health bonus. And the laser upgrade enables the player to ... exactly, to shoot lasers. And that's with the press of a button on (B) or [J]. 


The actor doesn't just fly away, though, like with the batteries, but waits patiently in place until the player picks it up. The local variable $used determines in which state the Lootbox is. That is, whether it has yet to open or has already released the upgrade that is to be used when touched.

The player is raised to the next upgrade level after this touch, depending on the current upgrade level. This is done by the player upgrade script. However, if upgrade level 2, the laser upgrade, is already active, the upgrade is stored by the variable $Upgrade_stored and can be used later, after taking damage, by pressing (Select) or [Shift].


Get GB Space Jump -2.0

Leave a comment

Log in with itch.io to leave a comment.