mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-25 17:00:54 +00:00
fixed monty mole sign = 0
This commit is contained in:
4
Scripts/Classes/Entities/Enemies/MontyMole.gd
Executable file → Normal file
4
Scripts/Classes/Entities/Enemies/MontyMole.gd
Executable file → Normal file
@@ -7,7 +7,9 @@ const ACCEL := 1.0
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
target_player = get_tree().get_first_node_in_group("Players")
|
||||
direction = sign(target_player.global_position.x - global_position.x)
|
||||
var dir = sign(target_player.global_position.x - global_position.x)
|
||||
if dir != 0:
|
||||
direction = dir
|
||||
$Sprite.scale.x = direction
|
||||
handle_movement(delta)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user