CHANNELS:

All
chris posted 2 years ago

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.

0

Want to participate?

Create a free Chris Courses account to begin

or
Sign In

Providing the lift to launch your development career

© 2024 Chris Courses. All rights reserved.