extends State

export (NodePath) var idle_node

onready var idle_state: State = get_node(idle_node)
var can_fire = true

func enter(state_modifiers: Array = []) -> void:
	.enter()
	parent.velocity.x = 0
	parent.set_hitbox(false)

func process_frame(_delta: float) -> State:
	if parent.player_detection.is_colliding() == false:
		return idle_state

	if animations.frame > 1:
		parent.set_hitbox(true)
	else:
		parent.set_hitbox(false)
		

	return null


func process_physics(delta: float) -> State:
	parent.velocity.y += gravity * delta
	#parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
	
	return null

func exit() -> void:
	parent.set_hitbox(false)
