TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ OnStarted()

override void Terraria.ModLoader.FlipperJump.OnStarted ( Player player,
ref bool playSound )
inlinevirtual

This hook runs when the player uses this jump via pressing the jump key
Effects that should appear when the jump starts can be spawned here.
For example, the Cloud in a Bottle's initial puff of smoke is spawned here.

To make the jump re-usable, set P:Terraria.DataStructures.ExtraJumpState.Available to true

Parameters
playerThe player performing the jump
playSoundWhether the poof sound should play. Set this parameter to false if you want to play a different sound.

Reimplemented from Terraria.ModLoader.ExtraJump.

Definition at line 19 of file FlipperJump.cs.

20 {
21 if (player.swimTime == 0)
22 {
23 player.swimTime = 30;
24 }
25 if (player.sliding)
26 {
27 player.velocity.X = 3 * -player.slideDir;
28 }
29 playSound = false;
30 player.GetJumpState(this).Available = true;
31 }

References Terraria.Player.slideDir, Terraria.Player.sliding, and Terraria.Player.swimTime.