disable input during animation

master
Fabien Freling 2019-12-09 23:54:35 +01:00
parent 6753848c8f
commit 09ff1b79f9
2 changed files with 5 additions and 0 deletions

View File

@ -63,6 +63,10 @@ func compute_piece_size() -> int:
return int(min(w_size, h_size))
func _input(event):
if $AnimationPlayer.is_playing():
# Disable input during animation
return
if event.is_action_pressed("ui_up"):
move_piece(Direction.DOWN)
if event.is_action_pressed("ui_down"):

View File

@ -35,6 +35,7 @@ color = Color( 0.254902, 0.329412, 0.45098, 1 )
anims/MovingPiece = SubResource( 1 )
[node name="MockPiece" parent="AnimationPlayer" instance=ExtResource( 2 )]
visible = false
position = Vector2( 175, 15 )
size = 160