function alienOneAttack() {
    if(!this.children[0].isWhacked) {
        this.children[0].isAttacking = Math.random() < 0.30;
        if(this.children[0].isAttacking) {
        this.children[0].style.pointerEvent = "none";
        this.children[0].style.backgroundImage = "url(https://daithishan.github.io/spaceambush/assets/images/game-assets/alien-one-red.svg)";
        score--;
        scoreDisplay.textContent = score;
        clickSound();
        setTimeout(() => {
    this.children[0].style.backgroundImage = "url(https://daithishan.github.io/spaceambush/assets/images/game-assets/alien-one.svg)";
    this.children[0].style.pointerEvent = "all";
  }, 600);
      }
  }
}
// This function sets probability and attack time of Alien One
This function sets probability and attack time of Alien One
This function sets probability and attack time of Alien One
function alienOneAttack() {
    if(!this.children[0].isWhacked) {
        this.children[0].isAttacking = Math.random() < 0.30;
        if(this.children[0].isAttacking) {
        this.children[0].style.pointerEvent = "none";
        this.children[0].style.backgroundImage = "url(https://daithishan.github.io/spaceambush/assets/images/game-assets/alien-one-red.svg)";
        score--;
        scoreDisplay.textContent = score;
        clickSound();
        setTimeout(() => {
    this.children[0].style.backgroundImage = "url(https://daithishan.github.io/spaceambush/assets/images/game-assets/alien-one.svg)";
    this.children[0].style.pointerEvent = "all";
  }, 600);
      }
  }
}
function alienOneAttack ( ) { if ( ! this . children [ 0 ] . isWhacked ) { this . children [ 0 ] . isAttacking = Math . random ( ) < 0.30 ; if ( this . children [ 0 ] . isAttacking ) { this . children [ 0 ] . style . pointerEvent = "none" ; this . children [ 0 ] . style . backgroundImage = "url(https://daithishan.github.io/spaceambush/assets/images/game-assets/alien-one-red.svg)" ; score -- ; scoreDisplay . textContent = score ; clickSound ( ) ; setTimeout ( ( ) => { this . children [ 0 ] . style . backgroundImage = "url(https://daithishan.github.io/spaceambush/assets/images/game-assets/alien-one.svg)" ; this . children [ 0 ] . style . pointerEvent = "all" ; } , 600 ) ; } } }
This function sets probability and attack time of Alien One
This function sets probability and attack time of Alien One