#1.1 Loot: Batteries
Batteries are the currency of this small prototype. The player can collect them and automatically gets one life exchanged for ten of them. But in order to do that, you have to pick them up first. And it works like this:
If the player touches the battery, the variable $Player_Battery is increased by one. Then the battery flies up to activate the item pickup. Afterwards the actor is hidden. Finally, the $Coin_used variable ensures that the same battery cannot be picked up multiple times. After the recording it is incremented by one. But the Actor script is only executed if $Coin_used == 0. This is taken care of by the If loop, which encloses the whole script.
If the scene has to be reloaded after the player has died, the variable $Reset_scene is set to 1. This resets the local $coin_used variable in the battery's On Init script to 0 so that the player can resume it in the new run.
This reset is necessary for ALL objects and enemies that the player interacts with in any way.
Get GB Space Jump -2.0
GB Space Jump -2.0
A Super Mario clone prototype in GB Studio 2.
More posts
- #3.1 Upgrades: PowerupsApr 08, 2022
- #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.