Skip to content
Snippets Groups Projects
Commit fe146070 authored by Guillaume IMHOFF's avatar Guillaume IMHOFF
Browse files

forgot to commit

parent 3a08d9cb
Branches
Tags
1 merge request!9Update merge
......@@ -45,6 +45,13 @@ offset_bottom = 1075.0
text = "PASS
"
[node name="Button2" type="Button" parent="Button2"]
offset_left = 661.0
offset_top = -990.0
offset_right = 819.0
offset_bottom = -942.0
text = "Back"
[node name="Cardslots2" type="Node2D" parent="."]
z_index = -1
......@@ -111,3 +118,4 @@ rotation = 1.5708
[connection signal="tree_exited" from="." to="." method="_on_tree_exited"]
[connection signal="pressed" from="Button" to="card_manager" method="_on_play_pressed"]
[connection signal="pressed" from="Button2/Button2" to="." method="_on_button_2_pressed"]
......@@ -45,14 +45,14 @@ func _process(_delta):
func _data_received_handler(data):
print(data)
match int(data["code"]):
match data["function"]:
"connected":
# Connected to the server game
pass
"starting":
hand._card_hand_init(data["id"], data["card_hand"], data["first_player"])
"played":
match (data["id"] - Global.online_game_id % 4):
match (int(data["id"] - Global.online_game_id) % 4):
1:
enemy_played(enemyhandleft, cardslotleft, data["card"], enemyhandleft.lst_card_in_slot)
2:
......@@ -71,7 +71,8 @@ func enemy_played(hand, cardslot, list_card, lst_card_in_slot):
new_card.form = card_info[0]
new_card.file = card
new_card.name="Card"
new_card.scale=card_scale
new_card.scale= card_scale
new_card.img = new_texture
var children_slots = cardslot.get_children()
var children_slot = null
......@@ -102,3 +103,7 @@ func _server_handshake():
})
socket.send_text(content)
func _on_button_2_pressed() -> void:
get_tree().change_scene_to_file("res://GameStarter/ChooseModePage.tscn")
......@@ -3,7 +3,7 @@ extends Node
var websocket_url = "wss://185.155.93.105:18005"
var server_url = "wss://185.155.93.105:18006" # turn into wss://185.155.93.105:18006
var username = ""
var online_game_id = -1 # no game
var online_game_id = 1000 # no game
func get_card_info_from_texture(path:String)->Array:
var card_info=[null, null]
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment