So, I'm making a game on HTML Canvas using JavaScript. Long story short, there's a bunch of variables that are executed at the start of the game. Some of them define player speed or enemy damage etc. You get my point. Thing is, I would like to make a config.txt file that defines all the important variables, and then set up the code to read that txt file and assign variables their values based on that. How can I do it?
Most of the variables are integers, so it would need to transform what I assume would be a string to integers for it to work properly.