Files
Super-Mario-Bros.-Remastere…/Scripts/Classes/Entities/Enemies/BooBuddies.gd
2025-10-17 17:12:57 +01:00

11 lines
468 B
GDScript

extends Enemy
@export_range(25, 180) var length := 80
@export_range(4, 12) var boo_amount := 10
@export var spread_boos := false
func _physics_process(delta: float) -> void:
%RotationJoint.global_rotation_degrees = wrap(%RotationJoint.global_rotation_degrees + (45 * [1, -1][direction]) * delta, 0, 360)
for i in $Boos.get_children():
i.get_node("Sprite").scale.x = sign(get_tree().get_first_node_in_group("Players").global_position.x + 1 - i.global_position.x)