Parcourir la source

Fix duplicated moves

tween callback were called twice when player was turning, accelerating
the movement and creating unexpected behaviors.
DricomDragon il y a 5 ans
Parent
commit
677f8f8fe7
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 1 1
      CharTween.gd
  2. 1 1
      Player.gd

+ 1 - 1
CharTween.gd

@@ -7,7 +7,7 @@ func _ready():
 	pass # Replace with function body.
 
 func connect_into(o):
-	connect("tween_completed", o, "_on_tween_completed")
+	connect("tween_all_completed", o, "_on_tween_completed")
 	pass
 
 func move_char(c, t_pos):

+ 1 - 1
Player.gd

@@ -68,7 +68,7 @@ func _physics_process(delta):
 func _on_game_start():
 	move()
 
-func _on_tween_completed(o, k):
+func _on_tween_completed():
 	move()
 
 func _on_crash(b):