chessgame/MoveTile.gd
jake e31a2fd04f correctly calculate checkmate.
move check_for_promotion() at the very start of new turn.

add green color for MoveTile.gd (for showing map control)

add some functions that show board control.

modify some functions so that they will use 'text_board' rather than the player presented board.
2023-02-21 13:32:39 -05:00

23 lines
555 B
GDScript

extends Node2D
signal move_clicked
const blue = Color(0.30, 0.71, 0.96, 0.54)
const red = Color(1.00, 0.00, 0.00, 0.15)
const green = Color(0.00, 1.00, 0.00, 0.15)
export var en_passant_tile = false
export var en_passant_kill_tile = false
export var castling_rook = ""
func _on_Area2D_input_event(_viewport, event, _shape_idx):
if event.is_action_pressed("mouse1"):
emit_signal("move_clicked")
func set_color(color):
if color == "blue":
$Rect.color = blue
elif color == "red":
$Rect.color = red
elif color == "green":
$Rect.color = green