Player

┗> Character > Object > Class


The character controlled by the player when in the Overworld.


Constructor


Player(chara: number, x: number, y: number)

Arguments:

chara: number
x: number
y: number




Methods


Player:alignFollowers(facing: string?, x: number?, y: number?, dist: number?)

Aligns the player's followers' directions and positions.

Arguments:

facing: string?

The direction every character should face (Defaults to player's direction)

x: number?

The x-coordinate of the 'front' of the line. (Defaults to player's x-position)

y: number?

The y-coordinate of the 'front' of the line. (Defaults to player's y-position)

dist: number?

The distance between each follower.



Player:beginClimbDismount(last_state: any, settings: any)

Arguments:

last_state: any
settings: any


Player:beginClimbMount(last_state: any, settings: any)

Arguments:

last_state: any
settings: any




Player:climbFall(time: integer, settings: ClimbFallSettings?)

Make the player fall while in the climb state. Does nothing if the player is not climbing.

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.











Player:getCurrentSpeed(running: any)

Arguments:

running: any

Returns:

1: integer




Player:getDebugOptions(context: ContextMenu)

Arguments:

context: ContextMenu

Returns:

1: ContextMenu








Player:interpolateFollowers()

Adds all followers' current positions to their movement history.















Player:onAdd(parent: World)

Arguments:

parent: World

The World Object manages everything relating to the overworld in Kristal.
A globally available instance of World is stored in Game.world.





Player:onRemove(parent: World)

Arguments:

parent: World

The World Object manages everything relating to the overworld in Kristal.
A globally available instance of World is stored in Game.world.







Player:preDraw(dont_transform: any)

Arguments:

dont_transform: any




Player:queueClimbDismount(settings: ClimbDismountSettings)

Requests that the player exits the climb state, jumping to a defined location.

Arguments:

settings: ClimbDismountSettings

The settings for the climb dismount.





Player:setActor(actor: any)

Arguments:

actor: any


Player:setState(state: any, ...: unknown)

Arguments:

state: any
...: unknown


Player:shouldDecreaseInvuln()

Whether the player should decrease the invulnerability timer.

This returns true if the state's shouldDecreaseInvuln callback returns true, or if World:shouldBulletsHurt() returns true.

Returns:

decrease_invuln: boolean?

true if the invulnerability timer should decrease.












Undocumented