I’m making a React App JavaScript game, and I am trying to figure out the best method for importing classes in a character select feature.
As there will be different characters used based on what characters the user chooses, I can’t just import the same classes and create new instances of the same classes.
How can I import classes in real time based on the users choices, and create new instances of said classes.
For example: When the user adds a warrior class character to their team, I want to import the warrior class, and create a new warrior instance like “const userWarrior = new Warrior(…)”