fixed monty mole sign = 0

This commit is contained in:
JHDev2006
2025-10-24 11:41:09 +01:00
parent 3bfd80b68f
commit 925a7d597d
2 changed files with 7 additions and 3 deletions

4
Scripts/Classes/Entities/Enemies/MontyMole.gd Executable file → Normal file
View 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)

View File

@@ -314,8 +314,10 @@ func tally_time() -> void:
score_tally_finished.emit()
func cancel_score_tally() -> void:
score_tween.kill()
time_tween.kill()
if score_tween != null:
score_tween.kill()
if time_tween != null:
time_tween.kill()
tallying_score = false
$ScoreTally.stop()