From 15a1d2a66e48324e1d560dc13b776627820f3999 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 27 Oct 2024 15:52:48 +0100 Subject: next commit --- Stages/Wintermaul/wintermaul.gd | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'Stages/Wintermaul/wintermaul.gd') diff --git a/Stages/Wintermaul/wintermaul.gd b/Stages/Wintermaul/wintermaul.gd index 9219a29..e66a979 100644 --- a/Stages/Wintermaul/wintermaul.gd +++ b/Stages/Wintermaul/wintermaul.gd @@ -40,8 +40,8 @@ func _ready(): }) # set camera limits - $Camera.limit_left = $Map.get_used_rect().position.x * %Map.tile_set.tile_size.x - $Camera.limit_right = $Map.get_used_rect().end.x * %Map.tile_set.tile_size.x + $Camera.limit_left = $Map.get_used_rect().position.x * %Map.tile_set.tile_size.x - %Map.tile_set.tile_size.x + $Camera.limit_right = $Map.get_used_rect().end.x * %Map.tile_set.tile_size.x - %Map.tile_set.tile_size.x $Camera.limit_top = %Map.get_used_rect().position.y * %Map.tile_set.tile_size.y $Camera.limit_bottom = %Map.get_used_rect().end.y * %Map.tile_set.tile_size.y @@ -87,8 +87,9 @@ func place_tower(remote_data: Dictionary): var player = Network.get_player(tower.owner_id) player.towers[tower.global_position] = tower - if multiplayer.is_server(): - Network.update_player.rpc(player.id, {"money": -5}) + player.money -= 5 + Network.players_changed.emit() + #Network.update_player.rpc(player.id, {"money": -5}) _place_tower(%Towers, tower) Client.placed_tower.emit(tower) @@ -111,12 +112,15 @@ func spawn_unit(remote_data: Dictionary): update_lives.rpc("top", -1) ) - Network.update_player.rpc(player.id, { - "money": -5, - "income": 1, - }) - - _spawn_unit(%Units, unit) + #Network.update_player.rpc(player.id, { + #"money": -5, + #"income": 1, + #}) + player.money -= 5 + player.income += 1 + Network.players_changed.emit() + + _spawn_unit(%Towers, unit) func can_place_tower(): -- cgit v1.2.3