mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 23:48:11 +00:00
added the game
This commit is contained in:
17
Scripts/Classes/Entities/Enemies/PiranhaPlant.gd
Normal file
17
Scripts/Classes/Entities/Enemies/PiranhaPlant.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
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")
|
Reference in New Issue
Block a user