Procházet zdrojové kódy

Fix duplicated moves

tween callback were called twice when player was turning, accelerating
the movement and creating unexpected behaviors.
DricomDragon před 5 roky
rodič
revize
677f8f8fe7
2 změnil soubory, kde provedl 2 přidání a 2 odebrání
  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):