This is a segment of the code for my program. What I'm trying to do is match the health of the enemy with the random enemy that get selected. My plan is to make a condition for when the randomInt selects a number so I can print out the correct enemyHealth value from my array. Is there any way I can set the a condition for when rand.nextInt is equal to some number?
if(rand.nextInt(enemy.enemyType) = 0)
System.out.println(enemy.enemyHealth[0]);
Aucun commentaire:
Enregistrer un commentaire