JocSah2/White_pawn.gd

16 lines
470 B
GDScript3
Raw Permalink Normal View History

2024-07-12 12:16:17 +03:00
extends Area2D
# Proprietăți pion
var type = "pawn"
var color = "white"
func _ready():
# Folosim Callable pentru a conecta semnalul
connect("input_event", Callable(self, "_on_pion_input_event"))
func _on_pion_input_event(viewport, event, shape_idx):
if event is InputEventMouseButton and event.pressed:
if event.button_index == MOUSE_BUTTON_LEFT:
print("Pionul alb a fost click-uit.")
get_parent()._on_piece_input_event(viewport, event, shape_idx, self)