Skip to content

Commit

Permalink
Add comment about map swapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Kvel2D committed Nov 9, 2024
1 parent e2d4c22 commit b5d7598
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/game_scene/game_scene.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions src/map/map.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b5d7598

Please sign in to comment.