mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
18 lines
477 B
GDScript
18 lines
477 B
GDScript
extends Enemy
|
|
|
|
@export var player_range := 24
|
|
|
|
func _enter_tree() -> void:
|
|
$Animation.play("Hide")
|
|
|
|
func _ready() -> void:
|
|
print(abs(global_rotation_degrees))
|
|
if is_equal_approx(abs(global_rotation_degrees), 180) == false:
|
|
$Sprite/Hitbox/UpsideDownExtension.queue_free()
|
|
$Timer.start()
|
|
|
|
func on_timeout() -> void:
|
|
var player = get_tree().get_first_node_in_group("Players")
|
|
if abs(player.global_position.x - global_position.x) >= player_range:
|
|
$Animation.play("Rise")
|