![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
An air movement that has a variable height jump and in which the horizontal speed has some inertia before coming to a stop (i.e. is not instantly changed). Similar to SMB. More...
Public Member Functions | |
override Movement | Init (Character character, MovementVariable[] movementData) |
Initialise the movement with the given movement data. More... | |
override void | GainControl () |
Called when the movement gets control. Typically used to do initialisation of velocity and the like. More... | |
override void | DoJump () |
Do the jump by translating and applying velocity. More... | |
![]() | |
override bool | WantsJump () |
Gets a value indicating whether this movement wants to intiate the jump. More... | |
override void | DoMove () |
Moves the character. More... | |
override Movement | Init (Character character, MovementVariable[] movementData) |
Initialise the movement with the given movement data. More... | |
override bool | ForceMaintainControl () |
If the jump just started force control. More... | |
override void | LosingControl () |
Called when the movement loses control. Override to do any reset type actions. More... | |
override void | DoOverridenJump (float newHeight, int ignoredJumpCount, bool skipPowerUps=false) |
Do the jump with overriden height and jumpCount. More... | |
![]() | |
virtual bool | WantsAirControl () |
Gets a value indicating whether this movement wants to control the movement in the air. Default is false with movement falling back to default air. Override if you want control. More... | |
virtual void | DoOverridenMove (bool moveInX, bool moveInY, float xInput, ButtonState runButton) |
Partially moves the character. A lot of movements (e.g. wall movements) require partial air movement. This allows them to use the air movement instead of re-implementing the movement. More... | |
virtual float | GetSpeed (float baseSpeed) |
Gets the air speed. More... | |
virtual float | GetRunSpeed (float baseRunSpeed) |
Gets the run speed. More... | |
virtual float | GetAcceleration (float baseAcceleration) |
Gets the acceleration. More... | |
virtual float | GetJumpHeightOrForce (float baseHeight) |
Gets the jump height or the jump force. More... | |
virtual float | GetDoubleJumpHeightOrForce (float baseHeight) |
Gets the double jump height or the double jump force. More... | |
![]() | |
sealed override Movement | Init (Character character) |
Initialise this movement. More... | |
bool | IsMovementDataDifferent (MovementVariable[] originalMovementData) |
Determines whether this instances movement data is different from the supplied originalMovementData. More... | |
Public Attributes | |
float | airSpeedRun |
The (horizontal) speed the character moves at in the air while run is depressed. More... | |
float | airSpeedAcceleration |
Rate at which the air speed in X increases when holding left or right. More... | |
float | airSpeedDeceleration |
Rate at which the air speed in X slows down when not holding left or right. More... | |
![]() | |
float | airSpeed |
The (horizontal) speed the character moves at in the air. More... | |
float | minJumpHeight |
Smallest height the character can jump More... | |
float | maxJumpHeight |
Largest height the character can jump. More... | |
float | maxJumpAccelerationTime |
How long the character has to hold the jump button to jump the max height. More... | |
float | relativeJumpGravity |
The gravity applied during jump (relative to the characters Gravity component). More... | |
float | groundedLeeway |
After the user leaves the ground how much additional time do we give the user to press jump and still consider them grounded. More... | |
bool | jumpWhenButtonHeld |
Automatically jump when the character holds the jump button down. More... | |
bool | canDoubleJump |
Can the character double jump. More... | |
float | doubleJumpHeight |
How high the character jumps on a double jump. More... | |
Protected Member Functions | |
override void | MoveInX (float horizontalAxis, int horizontalAxisDigital, ButtonState runButton) |
Do the X movement. More... | |
![]() | |
override void | MoveInY () |
Do the Y movement. More... | |
![]() | |
virtual void | AddGravityFlipHandler () |
Add handler for the gravity flip event More... | |
virtual void | HandleGravityFlipped (object sender, System.EventArgs e) |
Handles the gravity being flipped. More... | |
Protected Attributes | |
bool | isForceRun |
If the previous movement was a run movement, then this should be a run too. More... | |
bool | isTravellingFasterThanMax |
Don't allow run to faster than the speed the jump started at (unless its smaller than jump walk speed) More... | |
![]() | |
float | initialVelocity |
Derived initial velocity based on minJumpHeight and relativeGravity. More... | |
float | readyToJumpTimer |
Character can only jump if this timer is less than zero. More... | |
bool | jumpStart |
True before the jump leaves the ground. More... | |
bool | showJumpStartedAnimation |
Ensure we play the jump start animation. More... | |
float | jumpHeldTimer |
Times how long player has held Jump button. More... | |
float | startingYPosition |
Track where the last jump started so we can calculate speed that should be set each frame. More... | |
float | actualMaxJumpHeight |
The actual height of the max jump this can change when for example we get an overriden jump from something like a springbaord platform. More... | |
int | jumpCount |
The jump count. More... | |
![]() | |
FlippableGravity | flippableGravity |
Cached reference to a flippable gravity. More... | |
![]() | |
Movement | implementation |
The class that will do the movement. More... | |
string | movementType |
The type of movement as a string. More... | |
MovementVariable[] | movementData |
Data that should be applied to the movement type on init. More... | |
Static Protected Attributes | |
const float | DefaultAirSpeedRun = 8.0f |
The default air speed while run is depressed. More... | |
const float | DefaultAirSpeedAcceleration = 45.0f |
The default air speed acceleration. More... | |
const float | DefaultAirSpeedDeceleration = 25.0f |
The default air speed deceleration. More... | |
const int | AirSpeedRunIndex = 7 |
The index of the air speed run in the movement settings. More... | |
const int | AirSpeedAccelerationIndex = 8 |
The index of the air speed acceleration in the movement settings. More... | |
const int | AirSpeedDecelerationIndex = 9 |
The index of the air speed acceleration in the movement settings. More... | |
new const int | MovementVariableCount = 10 |
The size of the movement variable array. More... | |
![]() | |
const float | DefaultAirSpeed = 5.0f |
The default air speed. More... | |
const float | DefaultMinJumpHeight = 0.75f |
The default min height of the jump. More... | |
const float | DefaultMaxJumpHeight = 2.5f |
The default max height of the jump. More... | |
const float | DefaultRelativeJumpGravity = 1.5f |
The default relative jump gravity. More... | |
const float | DefaultGroundedLeeway = 0.1f |
The default grounded leeway. More... | |
const float | DefaultMaxJumpAccelerationTime = 0.25f |
The default max jump acceleration time. More... | |
const int | AirSpeedIndex = 0 |
The index for the air speed value in the movement data. More... | |
const int | MinJumpHeightIndex = 1 |
The index for the min jump height in the movement data. More... | |
const int | MaxJumpHeightIndex = 2 |
The index for the max jump height in the movement data. More... | |
const int | MaxJumpAccelerationTimeIndex = 3 |
The index for the Max Jump Accereration in the movement data. More... | |
const int | JumpRelativeGravityIndex = 4 |
The index for the relative jump gravity in the movement data. More... | |
const int | GroundedLeewayIndex = 5 |
The index for the ground leeway in the movement data. More... | |
const int | JumpWhenButtonHeldIndex = 6 |
The index for the Jump When Button Held in the movement data. More... | |
const int | CanDoubleJumpIndex = 7 |
The index of the can double jump value in the movement data. More... | |
const int | MovementVariableCount = 8 |
The size of the movement variable array. More... | |
Properties | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
![]() | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
override bool | ShouldApplyGravity [get] |
This class will handle gravity internally. More... | |
override float | CurrentGravity [get] |
Gets a value indicating the current gravity, only used if this movement doesn't apply the default gravity.
| |
override AnimationState | AnimationState [get] |
Gets the animation state that this movement wants to set. More... | |
override int | AnimationPriority [get] |
Gets the priority for the animation state. More... | |
override int | FacingDirection [get] |
Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. This overriden version always returns the input direction. More... | |
![]() | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
![]() | |
virtual string | MovementType [get, set] |
The type of movement as a string. More... | |
virtual MovementVariable[] | MovementData [get, set] |
Data that should be applied to the movement type on init. More... | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
override bool | Enabled [get, set] |
A custom enable which base movements can use to pass on enable values. More... | |
override Movement | Implementation [get] |
Gets the underlying implementation. More... | |
An air movement that has a variable height jump and in which the horizontal speed has some inertia before coming to a stop (i.e. is not instantly changed). Similar to SMB.
|
virtual |
Do the jump by translating and applying velocity.
Reimplemented from PlatformerPro.AirMovement_Variable.
override void PlatformerPro.AirMovement_VariableWithInertiaV2.GainControl | ( | ) |
Called when the movement gets control. Typically used to do initialisation of velocity and the like.
override Movement PlatformerPro.AirMovement_VariableWithInertiaV2.Init | ( | Character | character, |
MovementVariable[] | movementData | ||
) |
|
protectedvirtual |
Do the X movement.
Reimplemented from PlatformerPro.AirMovement_Variable.
float PlatformerPro.AirMovement_VariableWithInertiaV2.airSpeedAcceleration |
Rate at which the air speed in X increases when holding left or right.
|
staticprotected |
The index of the air speed acceleration in the movement settings.
float PlatformerPro.AirMovement_VariableWithInertiaV2.airSpeedDeceleration |
Rate at which the air speed in X slows down when not holding left or right.
|
staticprotected |
The index of the air speed acceleration in the movement settings.
float PlatformerPro.AirMovement_VariableWithInertiaV2.airSpeedRun |
The (horizontal) speed the character moves at in the air while run is depressed.
|
staticprotected |
The index of the air speed run in the movement settings.
|
staticprotected |
The default air speed acceleration.
|
staticprotected |
The default air speed deceleration.
|
staticprotected |
The default air speed while run is depressed.
|
protected |
If the previous movement was a run movement, then this should be a run too.
|
protected |
Don't allow run to faster than the speed the jump started at (unless its smaller than jump walk speed)
|
staticprotected |
The size of the movement variable array.
|
staticget |
Static movement info used by the editor.