Methods
PlayerClimbState:cancelClimbCharge()
(Called internally) Cancels the climb charge state.
This should not be called by user code.
PlayerClimbState:chargeClimbCharge()
(Called internally) Updates the climb charge state, charging the jump.
This happens every frame while charge_state is 2 and the user is holding Z.
This should not be called by user code.
PlayerClimbState:checkClimbAreaExists()
(Called internally) Checks if the player is still in a climb area, and if not, initiates a climb fall.
This is not present in DELTARUNE, and is solely Kristal QOL.
This should not be called by user code.
PlayerClimbState:checkClimbBullets()
(Called internally) Checks the player's hurtbox against all bullets, and applies damage if necessary.
This should not be called by user code.
PlayerClimbState:checkClimbCollisions()
(Called internally) Checks the player's climb hitbox against any collidable objects.
If a ClimbEnemy is found, and the player is jumping, the enemy will be attacked.
This should not be called by user code.
PlayerClimbState:checkClimbExiting()
(Called internally) Checks if exiting the climb is queued up, and if so, sets the player's state to "CLIMB_DISMOUNT" with the appropriate settings.
This should not be called by user code.
PlayerClimbState:checkClimbLandings()
(Called internally) Checks for climb landings, and queues a climb exit if one is found.
This should not be called by user code.
PlayerClimbState:checkClimbMove()
(Called internally) Checks if the player has moved into a new grid space while climbing.
This ends up calling onClimbMove on the current climb area the player is on.
This should not be called by user code.
PlayerClimbState:fall(time: integer, settings: ClimbFallSettings?)
@param time — The amount of time (in frames) that it takes the player to attempt to re-grab the wall. Defaults to 20. Common values are 10, 15, 20, 24, 30, 34, and 80.
@param settings — The settings for the climb fall. Optional.
Arguments:
| time: integer | The amount of time (in frames) that it takes the player to attempt to re-grab the wall. Defaults to 20. Common values are 10, 15, 20, 24, 30, 34, and 80. |
| settings: ClimbFallSettings? | The settings for the climb fall. Optional. |
PlayerClimbState:finishClimbCharge()
(Called internally) Finishes the climb charge state, performing the jump.
This should not be called by user code.
PlayerClimbState:getOverlappingObjects(x: number?, y: number?, object: Object)
A (somewhat hacky) method to check for any world objects overlapping the player, without counting perfectly overlapping edges.
Arguments:
| x: number? | The x position to check for overlap. Defaults to the player's current x position. |
| y: number? | The y position to check for overlap. Defaults to the player's current y position. |
| object: Object | The class of object to check for overlap with. |
Returns:
| objects: Object | A list of objects that are overlapping the player. |
PlayerClimbState:handleClimbAttack()
(Called internally) Handles climb attacking logic.
This should not be called by user code.
PlayerClimbState:handleClimbBump()
(Called internally) Handles bumping while climbing.
This should not be called by user code.
PlayerClimbState:handleClimbCharge()
(Called internally) Handles climb charging logic.
This should not be called by user code.
PlayerClimbState:handleClimbFall()
(Called internally) Handles climb falling logic.
This should not be called by user code.
PlayerClimbState:handleClimbGrab()
(Called internally) Handles climb grabbing logic.
This should not be called by user code.
PlayerClimbState:handleClimbIdle()
(Called internally) Handles "neutral" movement.
This function is responsible for:
- Updating the "last climb position"
- Updating the "last safe climb position"
- Starting a climb (by pressing a direction key)
- Starting a jump charge (by pressing Z)
- Slowing the player's momentum if nothing is being pressed,
- And checking for climb exits, and queuing them up if the player is pressing the exit direction.
This should not be called by user code.
PlayerClimbState:handleClimbMovement()
(Called internally) Handles climb movement logic (moving normally or jumping).
This should not be called by user code.
PlayerClimbState:handleClimbRecover()
(Called internally) Updates the climb recover state, recovering the player back to the last safe position if they fell too far.
This should not be called by user code.
PlayerClimbState:initClimbBump()
(Called internally) Initializes the climb bump state.
This should not be called by user code.
PlayerClimbState:initClimbCharge()
(Called internally) Initializes the climb charge state.
To enter the climb charging state, set self.charge_state to 1.
This should not be called by user code.
PlayerClimbState:initClimbFall()
(Called internally) Initializes the climb falling state.
To enter the climb falling state, call self:climbFall() with the desired settings.
This should not be called by user code. See: Player.climbFall
PlayerClimbState:initClimbGrab()
(Called internally) Initializes the climb grab state.
This should not be called by user code.
PlayerClimbState:initClimbMove()
(Called internally) Initializes the climb move state.
This should not be called by user code.
PlayerClimbState:isIdle()
Returns whether or not the player can move normally -- this means they can start charging a jump, or they can move in the direction they're holding.
Returns:
| can_move: boolean |
PlayerClimbState:isOverlappingClimbable(x: number?, y: number?, object: ClimbArea)
A (somewhat hacky) method to check if the player is overlapping a ClimbArea, or a child of ClimbArea, without counting perfectly overlapping edges.
Arguments:
| x: number? | The x position to check for overlap. Defaults to the player's current x position. |
| y: number? | The y position to check for overlap. Defaults to the player's current y position. |
| object: ClimbArea | The class of object to check for overlap with. |
Returns:
| is_overlapping: boolean | |
| object: ClimbArea? | The object that the player is overlapping, if any. |
PlayerClimbState:isOverlappingInstance(obj: Object)
A (somewhat hacky) method to check if an object is overlapping the player, without counting perfectly overlapping edges.
Arguments:
| obj: Object | The class of object to check for overlap with. |
Returns:
| is_overlapping: boolean |
PlayerClimbState:isOverlappingObjectBounds(x: number?, y: number?, object: Object)
A (somewhat hacky) method to check if the player is overlapping a world object's bounds, without counting perfectly overlapping edges.
Arguments:
| x: number? | The x position to check for overlap. Defaults to the player's current x position. |
| y: number? | The y position to check for overlap. Defaults to the player's current y position. |
| object: Object | The class of object to check for overlap with. |
Returns:
| is_overlapping: boolean | |
| object: Object? | The object that the player is overlapping, if any. |
PlayerClimbState:queueExit(settings: ClimbDismountSettings)
Arguments:
| settings: ClimbDismountSettings |
PlayerClimbState:setDirection(direction: "down"|"left"|"right"|"up")
(Called internally) Sets the climbing direction, used for determining the "default" direction the player will charge a jump to.
direction:
| "right"
| "down"
| "left"
| "up"
Arguments:
| direction: "down"|"left"|"right"|"up" |
PlayerClimbState:shortenClimbBump()
(Called internally) Cuts a climb bump short if the player changes directions or attempts to jump.
This should not be called by user code.
PlayerClimbState:updateClimbBump()
(Called internally) Updates the climb bump state.
This should not be called by user code.
PlayerClimbState:updateClimbCamera()
(Called internally) Updates the camera in the climb state.
This should not be called by user code.
PlayerClimbState:updateClimbCharge()
(Called internally) Updates the climb charge state.
This function calls every frame while charge_state is 2.
This should not be called by user code.
PlayerClimbState:updateClimbFall()
(Called internally) Updates the climb falling state.
This should not be called by user code.
PlayerClimbState:updateClimbGrab()
(Called internally) Updates the climb grab state.
In this state, the player just grabbed onto the wall, and are sliding down slowly until they stop.
This should not be called by user code.
PlayerClimbState:updateClimbGrabEnd()
(Called internally) Updates the climb grab state.
In this state, the player has finished sliding down, and is easing back into position (on the grid).
This should not be called by user code.
PlayerClimbState:updateClimbMove()
(Called internally) Updates the climb move state.
This should not be called by user code.
PlayerClimbState:updateClimbTimers()
(Called internally) Updates climb timers and buffers.
This should not be called by user code.
Undocumented
PlayerClimbState.charge_sound: Sound
The sound class. This is a transparent wrapper over Love2D's Source.
PlayerClimbState.check_move: boolean
Initialized to false in DR! Unused, though. (checkdamagefloor)
PlayerClimbState.neutral_state: integer
0 = In other state, 1 = Can start moving/start charging
PlayerClimbState.up_buffer: integer
Input buffers for climbing