checkCollisionWithBody() {
        var obj = Phaser.Actions.GetFirst(this.getChildren(), {
            x: this.head.x,
            y: this.head.y
        }, 1);
        if (obj != null) {
            this.dead = true;
        }
    }
// The snake dies if it collides with its own body
The snake dies if it collides with its own body
The snake dies if it collides with its own body
checkCollisionWithBody() {
        var obj = Phaser.Actions.GetFirst(this.getChildren(), {
            x: this.head.x,
            y: this.head.y
        }, 1);
        if (obj != null) {
            this.dead = true;
        }
    }
checkCollisionWithBody ( ) { var obj = Phaser . Actions . GetFirst ( this . getChildren ( ) , { x : this . head . x , y : this . head . y } , 1 ) ; if ( obj != null ) { this . dead = true ; } }
The snake dies if it collides with its own body
The snake dies if it collides with its own body