This commit is contained in:
2021-01-30 09:44:49 +01:00
parent d84fdd4d00
commit 151903278c
18 changed files with 188 additions and 31 deletions

View File

@ -11,6 +11,9 @@ var _map
func _ready():
_is_free = true
_map = get_node("/root/Game_manager/Map")
var material = SpatialMaterial.new()
material.albedo_color = Color(1, 0.41, 0.71)
$Cylinder.set_surface_material(0, material)
func set_coordinates(x, y):
_x = x
@ -25,9 +28,31 @@ func _on_Area_input_event(camera, event, click_position, click_normal, shape_idx
get_node("/root/Game_manager/Mouse_controller").right_click_on_hex(self)
func set_color(color_id):
# TODO: make color better?
var material = SpatialMaterial.new()
material.albedo_color = Color(1, 0, 1)
if color_id == 0:
material.albedo_color = Color(0, 0, 0)
if color_id == 1:
material.albedo_color = Color(0, 0, 1)
if color_id == 2:
material.albedo_color = Color(0, 1, 0)
if color_id == 3:
material.albedo_color = Color(0, 1, 1)
if color_id == 4:
material.albedo_color = Color(1, 0, 0)
if color_id == 5:
material.albedo_color = Color(1, 0, 1)
if color_id == 6:
material.albedo_color = Color(1, 1, 0)
if color_id == 7:
material.albedo_color = Color(1, 1, 1)
$Cylinder.set_surface_material(0, material)
func occupy_hex():