17 lines
345 B
GDScript3
17 lines
345 B
GDScript3
|
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.54)
|
||
|
|
||
|
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":
|
||
|
color = blue
|
||
|
elif color == "red":
|
||
|
color = red
|