From 0697f674ec33f8381ba68cf064732ee40e6e584f Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sat, 12 Oct 2024 23:09:56 +0200 Subject: next commit --- Towers/Tower.gd | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Towers') diff --git a/Towers/Tower.gd b/Towers/Tower.gd index 10753eb..30af802 100644 --- a/Towers/Tower.gd +++ b/Towers/Tower.gd @@ -63,7 +63,7 @@ func _ready(): func _draw(): if is_selected: draw_circle( - Client.stage.map.tile_set.tile_size, + Client.current_stage.map.tile_set.tile_size, 8 + attack_range, Color(1, 1, 1, 0.75), false, @@ -73,7 +73,7 @@ func _draw(): elif is_hovered: if Client.state is StateDefault: draw_circle( - Client.stage.map.tile_set.tile_size, + Client.current_stage.map.tile_set.tile_size, 8 + attack_range, Color(1, 1, 1, 0.5), false, @@ -162,7 +162,7 @@ func redraw_components(): func is_melee_range(): - return attack_range <= (Client.stage.map.tile_set.tile_size.x * 2) + return attack_range <= (Client.current_stage.map.tile_set.tile_size.x * 2) func shoot(): @@ -249,6 +249,7 @@ func _on_h_box_container_2_gui_input(event: InputEvent) -> void: class NetworkData extends Resource: var name: String + var owner_id: int var position: Vector2 var components: Array @@ -259,6 +260,7 @@ func to_network_data() -> NetworkData: var data = NetworkData.new() data.name = name + data.owner_id = owner_id data.position = global_position data.components = components.map(func(item: TowerComponent): return item.name @@ -284,6 +286,7 @@ static func from_network_data(data: NetworkData) -> Tower: var tower: Tower = preload("res://Towers/Tower.tscn").instantiate() tower.name = data.name + tower.owner_id = data.owner_id tower.global_position = data.position return tower -- cgit v1.2.3