Cause the player GameObject to jump on certain inputs.
More...
|
| this (size_t owner, ComponentTransform transform, ComponentRender render) |
| Set up the script.
|
|
int | PreviewNextHeight () |
| Get the height that the GameObject will reach on the next frame.
|
|
void | ResetGrounded () |
| Reset the state of the jump to not be grounded.
|
|
void | StopJump (int landHeight) |
| Stop jumping and remain grounded at a given height.
|
|
override void | Update () |
| Move the GameObject to the next location based on the gravity motion.
|
|
| this (size_t id) |
| Store the owner id.
|
|
override void | Render (SDL_Renderer *renderer, SDL_Rect *camera) |
| Render the given script.
|
|
|
ComponentTransform | mTransform |
| The ComponentTransform of the linked GameObject.
|
|
ComponentRender | mRender |
| The ComponentRender of the linked GameObject.
|
|
float | jumpVelocity = 0.0 |
| Initial velocity when the jump starts.
|
|
const float | jumpStrength = -13.0 |
| Initial jump velocity (negative for upward motion).
|
|
const float | maxVelocity = 10.0 |
| The maximum velocity reachable during a fall.
|
|
bool | isGrounded = false |
| Whether the player is on the ground.
|
|
const int | groundLevel = 480 |
| The lowest possible ground level (the GameObject can never go below this).
|
|
const int | ceilingLevel = 0 |
| The height possible ceiling level (the GameObject can never go above this).
|
|
const float | rotationSpeed = 5.0f |
| Degrees per frame while jumping.
|
|
bool | isGravityFlipped = false |
| Whether gravity is flipped to be the opposite direction or not.
|
|
Cause the player GameObject to jump on certain inputs.
◆ this()
Set up the script.
- Parameters
-
◆ PreviewNextHeight()
int ComponentPlayerInputJump::PreviewNextHeight |
( |
| ) |
|
|
inline |
◆ ResetGrounded()
void ComponentPlayerInputJump::ResetGrounded |
( |
| ) |
|
|
inline |
Reset the state of the jump to not be grounded.
Run this to enter a free-fall state.
◆ StopJump()
void ComponentPlayerInputJump::StopJump |
( |
int | landHeight | ) |
|
|
inline |
Stop jumping and remain grounded at a given height.
The GameObject will stop at landHeight as if it has landed on an object.
- Parameters
-
landHeight | the end height in pixels of the jump. |
◆ Update()
override void ComponentPlayerInputJump::Update |
( |
| ) |
|
|
inlinevirtual |
The documentation for this class was generated from the following file: