Slartibartfass2/DuneTowerDefense

Replace configuration properties file with json file and separate config objects

Opened this issue · 0 comments

For easier testing and implementation of configurations replace properties file with json file which can be parsed to Configuration object.

Probably it would be good to split the config file into several config files each for a component of the game e.g. a sound tower config file.
On the other hand this would complicate loading the files as one has to load a file for each component instead a single one.

So having one file with different config objects is probably the best way.

A starting point could be:

{
  "soundTowerConfig": {
    "range": 10,
    "reloadTime": 1000,
    ...
  },
  ...
}

The soundTowerConfig object could then be passed to each soundTower which then can read and adapt those values.

A schema should be created as well to verify the correctness of the file.