disable input during animation
This commit is contained in:
		
							parent
							
								
									6753848c8f
								
							
						
					
					
						commit
						09ff1b79f9
					
				
					 2 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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"):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue