Rebuilding Dragon Warrior in JavaScript for some reason