<aside> ⚡ script "map_bouncepad_vertical" (int force, int superforce, int sound)
</aside>
This script is called by the player whenever they step on a vertical bounce pad. The parameters are determined by the bounce pad on which they stepped on.
This script can replaced by adding a new script in your map of the name, map_bouncepad_vertical
, to add additional behavior to this event, or override the existing behavior.
This script has no expected return value.
force
: int - How much force to apply to the player when they are not holding jump.superforce
: int - How much force to apply to the player when they are holding jump.sound
: int - Which sound effect to play when launched.The default vertical bounce pad script has relatively universal behavior.
First, to prevent the player from getting unintended extra bounce, check for a short-lived powerup called "JumpPadDelay"
. This powerup lasts 8 tics. If the player has this powerup, stop the script. Otherwise, give it to them.
Next, do some simple checks to figure out how much force to apply to the player.
If superforce
is 0, populate it with the value of force.
Next, if the player is holding jump, apply superforce
. Otherwise, apply force
.
Finally, using sound
, play the bounce sound using the script "map_bouncesound"
.