Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.AirMovement_JetPack Class Reference

Jet pack based based air movement. More...

Inheritance diagram for PlatformerPro.AirMovement_JetPack:
PlatformerPro.AirMovement PlatformerPro.BaseMovement< AirMovement > PlatformerPro.AirMovement_DoubleJumpJetpack

Public Member Functions

override Movement Init (Character character, MovementVariable[] movementData)
 Initialise the mvoement with the given movement data. More...
 
override void DoMove ()
 Moves the character. More...
 
override bool ForceMaintainControl ()
 IF jetpack is engaged keep control More...
 
override bool WantsAirControl ()
 IF jetpack is engaged take control More...
 
virtual bool IsJetPackEngaged ()
 Is the jet pack engaged. More...
 
- Public Member Functions inherited from PlatformerPro.AirMovement
virtual bool WantsJump ()
 Gets a value indicating whether this movement wants to intiate the jump. More...
 
virtual void DoJump ()
 Do the jump. More...
 
virtual void DoOverridenJump (float newHeight, int jumpCount, bool skipPowerUps=false)
 Does a jump with overriden values for the key variables. Primarily used to allow platforms and wall jumps to affect jump height in non-physics based jumps. 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...
 
- Public Member Functions inherited from PlatformerPro.BaseMovement< AirMovement >
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 jetpackAcceleration
 The accleration applied in y when the jetpack is active. More...
 
float jetpackFuelConsumption
 How much fuel the jetpack uses per second. More...
 
string fuelItemType
 The id of a stackabe item used for fuel. More...
 
float airSpeed
 The (horizontal) speed the character moves at in the air. More...
 
float maxSpeed
 The maximum speed that can be achieved in the y direction. 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...
 
- Protected Member Functions inherited from PlatformerPro.AirMovement
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

ItemManager itemManager
 Cached copy of the item manager if this jet pack requires fuel. More...
 
float subIntFuelUsage
 We still want to use fuel even if we use less than 1 fuel per frame. This is where we track it. More...
 
- Protected Attributes inherited from PlatformerPro.AirMovement
FlippableGravity flippableGravity
 Cached reference to a flippable gravity. More...
 
- Protected Attributes inherited from PlatformerPro.BaseMovement< AirMovement >
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 DefaultJetpackAcceleration = 45.0f
 The default jetpack acceleration. More...
 
const float DefaultJetpackFuelConsumption = 0.0f
 The default jetpack fuel consumption. More...
 
const float DefaultAirSpeed = 5.0f
 The default air speed. More...
 
const float DefaultMaxSpeed = 5.0f
 The default max speed. More...
 
const int JetpackAcclerationIndex = 0
 The index for the Jet Pack Velocity in the movement data. More...
 
const int JetpackFuelConsumptionIndex = 1
 The index for the Jet Pack Fuel Consumption in the movement data. More...
 
const int FuelItemTypeIndex = 2
 The index for the Fuel Item Type in the movement data. More...
 
const int AirSpeedIndex = 3
 The index for the Air Speed in the movement data. More...
 
const int MaxSpeedIndex = 4
 The index for the Max Speed in the movement data. More...
 
const int MovementVariableCount = 5
 The size of the movement variable array. More...
 

Properties

new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. 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...
 
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.

See also
ShouldApplyGravity()
More...
 
- Properties inherited from PlatformerPro.AirMovement
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
- Properties inherited from PlatformerPro.BaseMovement< AirMovement >
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...
 

Detailed Description

Jet pack based based air movement.

Member Function Documentation

◆ DoMove()

override void PlatformerPro.AirMovement_JetPack.DoMove ( )

Moves the character.

◆ ForceMaintainControl()

override bool PlatformerPro.AirMovement_JetPack.ForceMaintainControl ( )

IF jetpack is engaged keep control

◆ Init()

override Movement PlatformerPro.AirMovement_JetPack.Init ( Character  character,
MovementVariable[]  movementData 
)

Initialise the mvoement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ IsJetPackEngaged()

virtual bool PlatformerPro.AirMovement_JetPack.IsJetPackEngaged ( )
virtual

Is the jet pack engaged.

Returns
true, if pack engaged was jeted, false otherwise.

Reimplemented in PlatformerPro.AirMovement_DoubleJumpJetpack.

◆ MoveInX()

override void PlatformerPro.AirMovement_JetPack.MoveInX ( float  horizontalAxis,
int  horizontalAxisDigital,
ButtonState  runButton 
)
protectedvirtual

Do the X movement.

Reimplemented from PlatformerPro.AirMovement.

◆ MoveInY()

override void PlatformerPro.AirMovement_JetPack.MoveInY ( )
protectedvirtual

Do the Y movement.

Reimplemented from PlatformerPro.AirMovement.

◆ WantsAirControl()

override bool PlatformerPro.AirMovement_JetPack.WantsAirControl ( )
virtual

IF jetpack is engaged take control

Reimplemented from PlatformerPro.AirMovement.

Member Data Documentation

◆ airSpeed

float PlatformerPro.AirMovement_JetPack.airSpeed

The (horizontal) speed the character moves at in the air.

◆ AirSpeedIndex

const int PlatformerPro.AirMovement_JetPack.AirSpeedIndex = 3
staticprotected

The index for the Air Speed in the movement data.

◆ DefaultAirSpeed

const float PlatformerPro.AirMovement_JetPack.DefaultAirSpeed = 5.0f
staticprotected

The default air speed.

◆ DefaultJetpackAcceleration

const float PlatformerPro.AirMovement_JetPack.DefaultJetpackAcceleration = 45.0f
staticprotected

The default jetpack acceleration.

◆ DefaultJetpackFuelConsumption

const float PlatformerPro.AirMovement_JetPack.DefaultJetpackFuelConsumption = 0.0f
staticprotected

The default jetpack fuel consumption.

◆ DefaultMaxSpeed

const float PlatformerPro.AirMovement_JetPack.DefaultMaxSpeed = 5.0f
staticprotected

The default max speed.

◆ fuelItemType

string PlatformerPro.AirMovement_JetPack.fuelItemType

The id of a stackabe item used for fuel.

◆ FuelItemTypeIndex

const int PlatformerPro.AirMovement_JetPack.FuelItemTypeIndex = 2
staticprotected

The index for the Fuel Item Type in the movement data.

◆ itemManager

ItemManager PlatformerPro.AirMovement_JetPack.itemManager
protected

Cached copy of the item manager if this jet pack requires fuel.

◆ jetpackAcceleration

float PlatformerPro.AirMovement_JetPack.jetpackAcceleration

The accleration applied in y when the jetpack is active.

◆ JetpackAcclerationIndex

const int PlatformerPro.AirMovement_JetPack.JetpackAcclerationIndex = 0
staticprotected

The index for the Jet Pack Velocity in the movement data.

◆ jetpackFuelConsumption

float PlatformerPro.AirMovement_JetPack.jetpackFuelConsumption

How much fuel the jetpack uses per second.

◆ JetpackFuelConsumptionIndex

const int PlatformerPro.AirMovement_JetPack.JetpackFuelConsumptionIndex = 1
staticprotected

The index for the Jet Pack Fuel Consumption in the movement data.

◆ maxSpeed

float PlatformerPro.AirMovement_JetPack.maxSpeed

The maximum speed that can be achieved in the y direction.

◆ MaxSpeedIndex

const int PlatformerPro.AirMovement_JetPack.MaxSpeedIndex = 4
staticprotected

The index for the Max Speed in the movement data.

◆ MovementVariableCount

const int PlatformerPro.AirMovement_JetPack.MovementVariableCount = 5
staticprotected

The size of the movement variable array.

◆ subIntFuelUsage

float PlatformerPro.AirMovement_JetPack.subIntFuelUsage
protected

We still want to use fuel even if we use less than 1 fuel per frame. This is where we track it.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.AirMovement_JetPack.AnimationState
get

Gets the animation state that this movement wants to set.

◆ CurrentGravity

override float PlatformerPro.AirMovement_JetPack.CurrentGravity
get

Gets a value indicating the current gravity, only used if this movement doesn't apply the default gravity.

See also
ShouldApplyGravity()

◆ FacingDirection

override int PlatformerPro.AirMovement_JetPack.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.

◆ Info

new static MovementInfo PlatformerPro.AirMovement_JetPack.Info
staticget

Static movement info used by the editor.

◆ ShouldApplyGravity

override bool PlatformerPro.AirMovement_JetPack.ShouldApplyGravity
get

This class will handle gravity internally.


The documentation for this class was generated from the following file: