function alienTwoAttack() {
    if(!this.children[1].isWhacked) {
        this.children[1].isAttacking = Math.random() < 0.39;
        if(this.children[1].isAttacking) {
        this.children[1].style.backgroundImage = "url(https://daithishan.github.io/spaceambush/assets/images/game-assets/alien-two-attack.svg)";
        score--;
        clickSound();
        scoreDisplay.textContent = score;
        setTimeout(() => {
    this.children[1].style.backgroundImage = "url(https://daithishan.github.io/spaceambush/assets/images/game-assets/alien-two.svg)";
  }, 500);
      }
  }
}
// This function sets the probability and attack time of Alien Two
This function sets the probability and attack time of Alien Two
This function sets the probability and attack time of Alien Two
function alienTwoAttack() {
    if(!this.children[1].isWhacked) {
        this.children[1].isAttacking = Math.random() < 0.39;
        if(this.children[1].isAttacking) {
        this.children[1].style.backgroundImage = "url(https://daithishan.github.io/spaceambush/assets/images/game-assets/alien-two-attack.svg)";
        score--;
        clickSound();
        scoreDisplay.textContent = score;
        setTimeout(() => {
    this.children[1].style.backgroundImage = "url(https://daithishan.github.io/spaceambush/assets/images/game-assets/alien-two.svg)";
  }, 500);
      }
  }
}
function alienTwoAttack ( ) { if ( ! this . children [ 1 ] . isWhacked ) { this . children [ 1 ] . isAttacking = Math . random ( ) < 0.39 ; if ( this . children [ 1 ] . isAttacking ) { this . children [ 1 ] . style . backgroundImage = "url(https://daithishan.github.io/spaceambush/assets/images/game-assets/alien-two-attack.svg)" ; score -- ; clickSound ( ) ; scoreDisplay . textContent = score ; setTimeout ( ( ) => { this . children [ 1 ] . style . backgroundImage = "url(https://daithishan.github.io/spaceambush/assets/images/game-assets/alien-two.svg)" ; } , 500 ) ; } } }
This function sets the probability and attack time of Alien Two
This function sets the probability and attack time of Alien Two