From df6a8cdaa04f3f639a53365d8d1597abe4cbec2d Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 11 Nov 2021 17:36:23 +0200 Subject: [PATCH] Removed code as Kroppec asked --- .../player_handlers/player_body_handler.gd | 4 -- .../server_handlers/trinity_site_level.gd | 39 ------------------- .../scripts/ui_element_handlers/game_UI.gd | 2 +- 3 files changed, 1 insertion(+), 44 deletions(-) diff --git a/source/assets/scripts/player_handlers/player_body_handler.gd b/source/assets/scripts/player_handlers/player_body_handler.gd index 8f7da90..8fad253 100644 --- a/source/assets/scripts/player_handlers/player_body_handler.gd +++ b/source/assets/scripts/player_handlers/player_body_handler.gd @@ -405,7 +405,6 @@ sync func hit_by_damager(damage): sync func enable() -> void: - direction = "left" hp = 100 can_shoot = false update_shoot_mode(false) @@ -421,9 +420,6 @@ sync func enable() -> void: if not Global.alive_players.has(self): Global.alive_players.append(self) - - weaponPositionalOffset = Vector2(-$"weaponHolder/Player-character-theme-gun-na3".texture.get_width() * $"weaponHolder/Player-character-theme-gun-na3".scale.x / 2,-$"weaponHolder/Player-character-theme-gun-na3".texture.get_height() * $"weaponHolder/Player-character-theme-gun-na3".scale.y / 2) + Vector2(-$weaponHolder.get_shape().get_radius(), 0) - $"weaponHolder/Player-character-theme-gun".position = weaponPositionalOffset sync func destroy() -> void: diff --git a/source/assets/scripts/server_handlers/trinity_site_level.gd b/source/assets/scripts/server_handlers/trinity_site_level.gd index 1b6bbdf..e9e25a1 100644 --- a/source/assets/scripts/server_handlers/trinity_site_level.gd +++ b/source/assets/scripts/server_handlers/trinity_site_level.gd @@ -3,51 +3,12 @@ extends Node2D var current_spawn_location_instance_number = 1 var current_player_location_instance_number = null -var gameControllerStates = {"singleplayer": false, "waiting": true, "allowMove": false, "allowShoot": false, "allowAim": false, "allowInput": false, "allowMenu": true, "simulatingEnvironment": false, "players": {}, "activePlayer": null} -var activePlayerIndicator = "0" -var gameTimer = 0 func _ready() -> void: get_tree().connect("network_peer_disconnected", self, "_player_disconnected") - if get_tree().is_network_server(): setup_player_positions() -func _process(delta): - gameTimer += delta - if not gameControllerStates["singleplayer"]: - if gameControllerStates["waiting"] and gameControllerStates["players"] != {} and not gameControllerStates["simulatingEnvironment"]: - if gameTimer > 5: - # Wait for tanks to fall to the ground - #gameControllerStates["allowMove"] = true - #gameControllerStates["activePlayer"] = gameControllerStates["players"] - #gameControllerStates["waiting"] = false - #gameTimer = 0 - pass - if gameControllerStates["allowMove"]: - # Get the active player and allow their inputs to have effect. - #print("Awaiting player input and processing it to adjust location and rotation") - # DO FOR EACH PLAYER - ONE AFTER THE OTHER - pass - if gameControllerStates["allowAim"] and gameControllerStates["allowInput"]: - # Get the active player and allow their input into adjusting function. - #print("Awaiting player input and processing it to adjust aim.") - # DO FOR EACH PLAYER - AT THE SAME TIME - pass - if gameControllerStates["allowShoot"]: - # Enable function locking feature and prepare for shooting phase -- simulatingEnvironment = true - #print("Awaiting player function confirmation.") - # DO FOR EACH PLAYER - AT THE SAME TIME - pass - if gameControllerStates["simulatingEnvironment"]: - # Ignore player input, request player weapons to fire the bullets and account for the damages. - # Reset the cycle back to the move stage if neither player won the game. - #print("Game result: undetermined, returning to move phase.") - pass - if gameControllerStates["singleplayer"]: - # Do not interrupt user input -> only request checking for victory. - #print("Singleplayer mode selected, awaiting game result.") - pass func setup_player_positions() -> void: for player in PersistentNodes.get_children(): diff --git a/source/assets/scripts/ui_element_handlers/game_UI.gd b/source/assets/scripts/ui_element_handlers/game_UI.gd index f2e07d4..279f5a9 100644 --- a/source/assets/scripts/ui_element_handlers/game_UI.gd +++ b/source/assets/scripts/ui_element_handlers/game_UI.gd @@ -1,7 +1,7 @@ extends CanvasLayer # if 0, then singleplayer will work, if 1, then multiplayer only -var winner_amount = 1 +var winner_amount = 0 onready var win_timer = $Control/winner/win_timer onready var winner = $Control/winner