Major rework of basic game code - pre-work for multiplayer
Includes automatic generation of required HTML elements and better responsiveness
This commit is contained in:
@@ -53,6 +53,17 @@ let firstRun = true;
|
||||
class Language {
|
||||
|
||||
constructor(lang) {
|
||||
const xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onreadystatechange = function () {
|
||||
if (this.readyState === 4 && this.status === 200) {
|
||||
const obj = JSON.parse(this.responseText);
|
||||
console.log(JSON.stringify(obj));
|
||||
}
|
||||
};
|
||||
|
||||
xmlhttp.open("GET", "/lang.json", true);
|
||||
xmlhttp.send();
|
||||
|
||||
this.lang = lang;
|
||||
if(eval('typeof ' + this.lang) === 'undefined')
|
||||
this.lang = "en";
|
||||
|
Reference in New Issue
Block a user