Prepared Movement behaviour. Fixed multi-tile placement bug
This commit is contained in:
parent
62eef907d3
commit
397082f966
17 changed files with 395 additions and 75 deletions
11
Game.gd
11
Game.gd
|
|
@ -10,7 +10,7 @@ var current_turn: int = 1
|
|||
func _ready():
|
||||
GameEvents.insect_tile_finished_moving.connect(_on_insect_tile_finished_moving)
|
||||
GameEvents.insect_tile_created.connect(_on_insect_tile_created)
|
||||
|
||||
GameEvents.pass_round.connect(_on_pass_round)
|
||||
# since we sealed in webrtc,
|
||||
# and limited players to 1 in enet
|
||||
# this should only happen when the opponent disconnects
|
||||
|
|
@ -21,6 +21,14 @@ func _ready():
|
|||
|
||||
GameEvents.game_started.emit()
|
||||
|
||||
|
||||
@rpc("any_peer", "call_local")
|
||||
func pass_round() -> void:
|
||||
advance_turn()
|
||||
|
||||
func _on_pass_round() -> void:
|
||||
pass_round.rpc()
|
||||
|
||||
func _on_peer_disconnected(id: int) -> void:
|
||||
GameData.disconnect_reason = "Connection to other peer closed unexpectedly"
|
||||
#Networking.disconnect_all()
|
||||
|
|
@ -31,6 +39,7 @@ func _on_peer_disconnected(id: int) -> void:
|
|||
#Networking.disconnect_all()
|
||||
# get_tree().change_scene_to_file("res://UI/main_menu.tscn")
|
||||
|
||||
|
||||
func advance_turn():
|
||||
GameEvents.turn_ended.emit(current_turn, map)
|
||||
is_blacks_turn = !is_blacks_turn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue