20 lines
438 B
GDScript
20 lines
438 B
GDScript
extends PlayerState
|
|
class_name PlayerOnFoot
|
|
|
|
|
|
func Enter():
|
|
character.jumps_remaining = character.MAX_JUMPS
|
|
|
|
func Physics_Update(delta):
|
|
if character.is_on_floor():
|
|
standard_movement(delta)
|
|
else:
|
|
Transitioned.emit(self,"in air")
|
|
|
|
if Input.is_action_just_pressed("crouch"):
|
|
Transitioned.emit(self,"crouched")
|
|
|
|
if Input.is_action_just_pressed("jump"):
|
|
character.jumps_remaining -= 1
|
|
character.velocity.y += standard_jump()
|