I am new to coding, and i am trying to make a game in javascript. I don't know why my HTML button is not calling my javascript function. I have tried moving the button to the bottom of the code, I have tried it with different functions, I have looked on some reference sites and i can't figure out why it is not working. Here is my button:
let waveActive = false;
let waveNumber = 0;
let enemyCount = 4;
let enemyAmount = 0;
let enemyHealth = 30;
function newWave() {
enemyCount + 25 %
Math.floor(enemyCount);
enemyHealth + 10 %
Math.floor(enemyHealth);
}
function startWave() {
waveNumber + 1;
waveActive = true;
newWave()
class enemySpawn {
main(Stringargs) {
int(i = enemyAmount)
while (i < enemyCount) {
Enemy = new component(30, 30, "purple", 10, 120);
enemyAmount + 1;
}
}
enemyAmount = 0;
}
}
<div name="buttonDiv">
<button type="button" id="startRoundBtn" onclick=startWave();>Start Round</button>
</div>