From b5d75986d0a5d4a25a5f1e8118feec0aadcb5ba0 Mon Sep 17 00:00:00 2001 From: Dmitry Degtyarev Date: Sat, 9 Nov 2024 06:23:02 +0100 Subject: [PATCH] Add comment about map swapping --- src/game_scene/game_scene.gd | 4 ++++ src/map/map.gd | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/game_scene/game_scene.gd b/src/game_scene/game_scene.gd index cbe5761f9..f06be27fb 100644 --- a/src/game_scene/game_scene.gd +++ b/src/game_scene/game_scene.gd @@ -40,6 +40,10 @@ func _ready(): PlayerManager.reset() GroupManager.reset() +# Replace small map with big map if playing in multiplayer +# NOTE: need to swap instead of using big map for both +# cases because big map makes the framerate worse, +# especially when playing in browser. var player_mode: PlayerMode.enm = Globals.get_player_mode() match player_mode: PlayerMode.enm.SINGLEPLAYER: diff --git a/src/map/map.gd b/src/map/map.gd index 072280103..003430b5a 100644 --- a/src/map/map.gd +++ b/src/map/map.gd @@ -13,6 +13,12 @@ class_name Map extends Node2D # free positioning. This TileMap has a smaller grid size # (64x32). Contains things like vegetation, barrels, etc. +# There are two variants of the map: small and big. Small +# contains 2 lanes and is used for singleplayer. Big +# contains 8 lanes and is used for multiplayer. Small +# variant is used to get the best performance on browser +# build. Swapping is done in GameScene._ready(). + # NOTE: explanation of z_index values for tilemap layers and units: # - 0 = lvl1-flat tilemap layer, this is for floor tiles on # lvl1 elevation