Skip to content

Loading the Map

RileyWhitty edited this page Sep 12, 2023 · 4 revisions

Map Loading

The map is loaded in the start of the game from the following repository location: source/core/assets/configs/Map.txt. In this text file, each character represents one of the above terrain tile sprites which are found in source/core/assets/images/. The following characters are assigned to the following sprites.

  • b: images/beach_1.png
  • B: images/beach_2.png
  • c: images/beach_3.png
  • d: images/deepWater_1.png
  • D: images/deepWater_2.png
  • s: images/desert_1.png
  • C: images/desert_2.png
  • S: images/desert_3.png
  • /: images/dirt_1.png
  • r: images/dirt_2.png
  • R: images/dirt_3.png
  • v: images/dirtPathBottom.png
  • <: images/dirtPathLeft.png
  • '>': images/dirtPathRight.png
  • ^: images/dirtPathTop.png
  • #: images/flowingWater_1.png
  • %: images/gravel_1.png
  • g: images/grass_1.png
  • G: images/grass_2.png
  • f: images/grass_3.png
  • i: images/ice_1.png
  • I: images/ice_2.png
  • l: images/lava_1.png
  • L: images/lavaGround_1.png
  • m: images/lavaGround_2.png
  • M: images/lavaGround_3.png
  • w: images/water_1.png
  • W: images/water_2.png
  • !: images/water_3.png
  • p: images/snow_1.png
  • P: images/snow_2.png
  • @: images/snow_3.png
  • &: images/stone_1.png
  • +: images/stonePath_1.png

The first 2 lines of the text file represent the width and height respectively of the map and can be any integer. Please ensure that these match up with the actual dimensions of the text map below otherwise errors will occur (You have been warned). the The map orientation of the text file is preserved when the game is started and the map is loaded. Any new map can be designed and added into the game by using the above symbols and adding the text file to the config folder. To ensure that the new map is loaded in instead of the one currently used, change the path1 and path2 TerrainFactory class variables to match to include the new map text file name that you have added to the config file.

Loading the default map that is currently in the configs folder in assets creates the below map.

image

Clone this wiki locally