src/games/snakeGame/Objects/snakeObject.js
/**
    * this method will check if snake is collided with itself or not
    * 
    */
this method will check if snake is collided with itself or not
this method will check if snake is collided with itself or not
isCollidedWithItself(){
     for (let i = 0; i < this.snakeCellArray.length; i++) {
        if ((this.snakeCellArray[i].xPos === this.mouthX && this.snakeCellArray[i].yPos === this.mouthY)) {
           return true;
        }
    }
    return false;
   }
isCollidedWithItself ( ) { for ( let i = 0 ; i < this . snakeCellArray . length ; i ++ ) { if ( ( this . snakeCellArray [ i ] . xPos === this . mouthX && this . snakeCellArray [ i ] . yPos === this . mouthY ) ) { return true ; } } return false ; }
this method will check if snake is collided with itself or not
this method will check if snake is collided with itself or not