I think you're on the right track. My initial thought process would be to assign a grouping of monsters to each battle zone. Based on which battle zone you're in, a monster from the battle zone's array would be chosen on random using the code you've written above:
const randomEnemy = monster.enemy[Math.floor(Math.random() * monster.enemy.length)]
Plug the randomEnemy
const into the battle initialization function, and I believe you should be good to go with that.
Want to participate?
Create a free Chris Courses account to begin