2023-02-17 11:37:23 -08:00
|
|
|
extends Node2D
|
|
|
|
|
|
|
|
signal move_clicked
|
|
|
|
|
|
|
|
const blue = Color(0.30, 0.71, 0.96, 0.54)
|
2023-02-21 10:32:39 -08:00
|
|
|
const red = Color(1.00, 0.00, 0.00, 0.15)
|
|
|
|
const green = Color(0.00, 1.00, 0.00, 0.15)
|
2023-02-17 11:37:23 -08:00
|
|
|
|
2023-02-18 13:41:27 -08:00
|
|
|
export var en_passant_tile = false
|
|
|
|
export var en_passant_kill_tile = false
|
|
|
|
export var castling_rook = ""
|
|
|
|
|
2023-02-18 14:23:22 -08:00
|
|
|
func _on_Area2D_input_event(_viewport, event, _shape_idx):
|
2023-02-17 11:37:23 -08:00
|
|
|
if event.is_action_pressed("mouse1"):
|
|
|
|
emit_signal("move_clicked")
|
|
|
|
|
|
|
|
func set_color(color):
|
|
|
|
if color == "blue":
|
2023-02-19 00:21:43 -08:00
|
|
|
$Rect.color = blue
|
2023-02-17 11:37:23 -08:00
|
|
|
elif color == "red":
|
2023-02-19 00:21:43 -08:00
|
|
|
$Rect.color = red
|
2023-02-21 10:32:39 -08:00
|
|
|
elif color == "green":
|
|
|
|
$Rect.color = green
|