#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
GB Space Jump -2.0
A Super Mario clone prototype in GB Studio 2.
More posts
- #3.3 Upgrades: Attack ScriptApr 08, 2022
- #2.1: UI: Battery CountApr 08, 2022
- #5.5 Scenes: Abyss and JetpackApr 08, 2022
- #3.2 Upgrades: Upgrade ScriptApr 08, 2022
- #2.2: UI: Upgrade DisplayApr 08, 2022
- #4.1 Enemies: BlobApr 08, 2022
- #4.2 Enemies: RobotApr 08, 2022
- #4.3 Enemies: WormApr 08, 2022
- #5.1 Scenes: GeneralApr 08, 2022
Leave a comment
Log in with itch.io to leave a comment.