extends Area2D func _on_damage_enemy2_body_entered(body): get_parent().fliph = not get_parent().global_position.x > body.global_position.x if get_parent().is_on_floor(): get_parent().state = 'shooting' pass # Replace with function body. func _on_damage_enemy2_body_exited(body): get_parent().state = 'runaround' pass # Replace with function body. func _ready(): scale.x = rand_range(0.5,2.0)