wip
This commit is contained in:
@ -2,6 +2,8 @@ extends Spatial
|
||||
|
||||
var _current_player_index
|
||||
|
||||
var _color_codes = []
|
||||
|
||||
var _turn_number
|
||||
|
||||
var _round_counter = 0
|
||||
@ -171,3 +173,12 @@ func _input(event):
|
||||
|
||||
func _on_Close_pressed():
|
||||
$Menu_panel.visible = false
|
||||
|
||||
func _on_Blocker_power_up_pressed():
|
||||
#TODO:
|
||||
# select 3 hexes, which will be blocked (make invisible?)
|
||||
pass # Replace with function body.
|
||||
|
||||
func _on_Reuse_Power_up_pressed():
|
||||
# TODO: you can click on hexes, which are already filled
|
||||
pass # Replace with function body.
|
||||
|
@ -66,10 +66,10 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="Player_info" type="Control" parent="GUI"]
|
||||
margin_left = 1650.14
|
||||
margin_top = 68.4775
|
||||
margin_right = 1910.14
|
||||
margin_bottom = 283.477
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
margin_left = -260.0
|
||||
margin_bottom = 215.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
@ -98,7 +98,7 @@ valign = 1
|
||||
[node name="Player_list" type="VBoxContainer" parent="GUI/Player_info/VBoxContainer"]
|
||||
margin_top = 18.0
|
||||
margin_right = 260.0
|
||||
margin_bottom = 214.0
|
||||
margin_bottom = 215.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
@ -186,11 +186,12 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="Bottom_left_panel" type="Control" parent="GUI"]
|
||||
anchor_top = 0.924074
|
||||
anchor_right = 0.233333
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = -79.9999
|
||||
margin_right = 420.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": true
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="GUI/Bottom_left_panel"]
|
||||
@ -215,14 +216,14 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="GUI/Bottom_left_panel/VBoxContainer"]
|
||||
margin_right = 447.0
|
||||
margin_bottom = 82.0
|
||||
margin_right = 420.0
|
||||
margin_bottom = 79.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Turn_label" type="Label" parent="GUI/Bottom_left_panel/VBoxContainer/HBoxContainer"]
|
||||
margin_right = 221.0
|
||||
margin_bottom = 82.0
|
||||
margin_right = 208.0
|
||||
margin_bottom = 79.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 7
|
||||
text = "Turn:"
|
||||
@ -230,14 +231,63 @@ align = 2
|
||||
valign = 1
|
||||
|
||||
[node name="Turn_indicator" type="Label" parent="GUI/Bottom_left_panel/VBoxContainer/HBoxContainer"]
|
||||
margin_left = 225.0
|
||||
margin_right = 447.0
|
||||
margin_bottom = 82.0
|
||||
margin_left = 212.0
|
||||
margin_right = 420.0
|
||||
margin_bottom = 79.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "1"
|
||||
valign = 1
|
||||
|
||||
[node name="Bottom_right_panel2" type="Control" parent="GUI"]
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = -420.0
|
||||
margin_top = -79.9999
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="GUI/Bottom_right_panel2"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="GUI/Bottom_right_panel2/VBoxContainer"]
|
||||
margin_right = 420.0
|
||||
margin_bottom = 79.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Blocker_power_up" type="Button" parent="GUI/Bottom_right_panel2/VBoxContainer/HBoxContainer"]
|
||||
margin_right = 208.0
|
||||
margin_bottom = 79.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "Blocker"
|
||||
|
||||
[node name="Reuse_Power_up" type="Button" parent="GUI/Bottom_right_panel2/VBoxContainer/HBoxContainer"]
|
||||
margin_left = 212.0
|
||||
margin_right = 420.0
|
||||
margin_bottom = 79.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
text = "Reuse Hexes"
|
||||
|
||||
[node name="Power_up_3" type="Button" parent="GUI/Bottom_right_panel2/VBoxContainer/HBoxContainer"]
|
||||
visible = false
|
||||
margin_left = 282.0
|
||||
margin_right = 420.0
|
||||
margin_bottom = 79.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Menu_panel" type="Control" parent="."]
|
||||
visible = false
|
||||
anchor_left = 0.5
|
||||
@ -299,5 +349,7 @@ script = ExtResource( 4 )
|
||||
[connection signal="tree_exited" from="." to="." method="_on_Game_manager_tree_exited"]
|
||||
[connection signal="pressed" from="End_game_panel/Back_to_lobby_button" to="." method="_on_Back_to_lobby_button_pressed"]
|
||||
[connection signal="pressed" from="GUI/Bottom_left_panel/VBoxContainer/Next_turn_button" to="." method="_on_Next_turn_button_pressed"]
|
||||
[connection signal="pressed" from="GUI/Bottom_right_panel2/VBoxContainer/HBoxContainer/Blocker_power_up" to="." method="_on_Blocker_power_up_pressed"]
|
||||
[connection signal="pressed" from="GUI/Bottom_right_panel2/VBoxContainer/HBoxContainer/Reuse_Power_up" to="." method="_on_Reuse_Power_up_pressed"]
|
||||
[connection signal="pressed" from="Menu_panel/Surrender_button" to="." method="_on_Surrender_button_pressed"]
|
||||
[connection signal="pressed" from="Menu_panel/Close" to="." method="_on_Close_pressed"]
|
||||
|
@ -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():
|
||||
|
Reference in New Issue
Block a user