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

View File

@ -0,0 +1,3 @@
source_md5="e127b8d3decb280181240c615e8cf87b"
dest_md5="1e9d1cf2df0ac5c1c7d726acf465bd1e"

View File

@ -0,0 +1,3 @@
source_md5="e127b8d3decb280181240c615e8cf87b"
dest_md5="1e9d1cf2df0ac5c1c7d726acf465bd1e"

View File

@ -0,0 +1,3 @@
source_md5="e127b8d3decb280181240c615e8cf87b"
dest_md5="1e9d1cf2df0ac5c1c7d726acf465bd1e"

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/background.jpg-3fd0dc8cec44f299d0635e3f8c73732e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Material/background.jpg"
dest_files=[ "res://.import/background.jpg-3fd0dc8cec44f299d0635e3f8c73732e.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -1,6 +1,6 @@
extends Node
const SERVER_IP = "willipink.eu"
const SERVER_IP = "127.0.0.1"
const SERVER_PORT = 14600
onready var _start_button = get_node("Start_button")
@ -17,8 +17,9 @@ func initialize_connection():
_start_button.text = "Connecting..."
func connect_to_server():
var peer = NetworkedMultiplayerENet.new()
peer.create_client(SERVER_IP, SERVER_PORT)
get_tree().connect("connected_to_server", self, "_connected_to_server")
var peer = WebSocketClient.new()
peer.connect_to_url("ws://" + SERVER_IP + ":" + str(SERVER_PORT), PoolStringArray(), true)
get_tree().set_network_peer(peer)
func _connected_ok():

View File

@ -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.

View File

@ -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"]

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():

View File

@ -39,7 +39,7 @@ func _on_Start_button_pressed():
NetworkingSync._players_ready = []
NetworkingSync.close_game()
if len(NetworkingSync._player_in_same_game_room_list) >= 2:
if len(NetworkingSync._player_in_same_game_room_list) >= 1: #TODO change to 2
for player_id in NetworkingSync._player_in_same_game_room_list:
if player_id[0] != Player.get_player_id():
rpc_id(player_id[0], "start_game")

View File

@ -7,7 +7,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../Godot_Executables/Client_linux/Client.x86_64"
export_path="../../../../Executables/hexagon_linux.x86_64"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""
@ -33,7 +33,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../Godot_Executables/Client_windows/Client.exe"
export_path="../../../../Executables/hexagon_win10.exe"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""
@ -75,7 +75,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../Godot_Executables/Client_web/Client_project.html"
export_path="../../../../Executables/Hexagon_web_rtc/hexagon.html"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""
@ -98,7 +98,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../Godot_Executables/Client_mac/Client.zip"
export_path="../../../../Executables/hexagon_macOS.zip"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

View File

@ -15,7 +15,7 @@ _global_script_class_icons={
[application]
config/name="Client_project"
config/name="Hexagon_webRTC_client"
run/main_scene="res://Scenes/Matchmaking/Menu/Menu.tscn"
config/icon="res://icon.png"

View File

@ -9,9 +9,11 @@ func _ready():
start_server()
func start_server():
print("Try to start the server.")
var peer = NetworkedMultiplayerENet.new()
var result = peer.create_server(SERVER_PORT, MAX_PLAYERS)
var peer = WebSocketServer.new()
var result = peer.listen(SERVER_PORT, PoolStringArray(), true)
get_tree().connect("server_disconnected", self, "_close_network")
get_tree().set_network_peer(peer)
print("Server started.")
if result != OK:
print("Failed creating the server.")

View File

@ -7,7 +7,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../Godot_Executables/Server_linux/Server.x86_64"
export_path="../../../../Executables/hexagon_linux_server.x86_64"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""
@ -65,3 +65,26 @@ application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""
[preset.2]
name="HTML5"
platform="HTML5"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""
[preset.2.options]
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/custom_html_shell=""
html/head_include=""
custom_template/release=""
custom_template/debug=""

View File

@ -15,7 +15,7 @@ _global_script_class_icons={
[application]
config/name="Server_project"
config/name="Hexagon_webRTC_server"
run/main_scene="res://Scenes/Matchmaking/Server/Server.tscn"
config/icon="res://icon.png"