diff options
Diffstat (limited to 'Towers')
-rw-r--r-- | Towers/Tower.gd | 9 |
1 files changed, 6 insertions, 3 deletions
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 |