diff options
Diffstat (limited to 'Stages/Wintermaul/wintermaul.gd')
-rw-r--r-- | Stages/Wintermaul/wintermaul.gd | 24 |
1 files changed, 14 insertions, 10 deletions
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(): |