update(dt) {
        this.x += this.speed * dt;
        // Detect when the enemy disappears from the right side of the screen
        if (this.x >= 500) {
            this.x = -100;
        }

        /* If the horizontal distance between an enemy and the player is less
         * than 60 pixels or the vertical distance is less than 13 pixels, there
         * was a collision between the enemy and the player.
         */
        if (Math.abs(Math.floor(player.x) - Math.floor(this.x)) <= 60 &&
           Math.abs(Math.floor(player.y) - Math.floor(this.y)) <= 13) {
            window.location.reload();
        }
    }
/**
     * @description Update the enemy's position, multiplying the speed by a time
     * delta between ticks to ensure the game runs at the same speed for all
     * computers. When the enemy disappear out of the right side of the screen,
     * it returns back from the left side of the screen.
     * When an enemy collides with the player, the game is reset.
     * @param {number} dt The time delta between ticks
     */
@description Update the enemy's position, multiplying the speed by a time
delta between ticks to ensure the game runs at the same speed for all
computers. When the enemy disappear out of the right side of the screen,
it returns back from the left side of the screen.
When an enemy collides with the player, the game is reset.
@param {number} dt The time delta between ticks
@description Update the enemy ' s position multiplying the speed by a time delta between ticks to ensure the game runs at the same speed for all computers . When the enemy disappear out of the right side of the screen it returns back from the left side of the screen . When an enemy collides with the player the game is reset . @param { number } dt The time delta between ticks
update(dt) {
        this.x += this.speed * dt;
        if (this.x >= 500) {
            this.x = -100;
        }
        if (Math.abs(Math.floor(player.x) - Math.floor(this.x)) <= 60 &&
           Math.abs(Math.floor(player.y) - Math.floor(this.y)) <= 13) {
            window.location.reload();
        }
    }
update ( dt ) { this . x += this . speed * dt ; if ( this . x >= 500 ) { this . x = - 100 ; } if ( Math . abs ( Math . floor ( player . x ) - Math . floor ( this . x ) ) <= 60 && Math . abs ( Math . floor ( player . y ) - Math . floor ( this . y ) ) <= 13 ) { window . location . reload ( ) ; } }
@description Update the enemy's position, multiplying the speed by a time
 delta between ticks to ensure the game runs at the same speed for all
 computers.
@description Update the enemy ' s position multiplying the speed by a time delta between ticks to ensure the game runs at the same speed for all computers .
// Detect when the enemy disappears from the right side of the screen /* If the horizontal distance between an enemy and the player is less
         * than 60 pixels or the vertical distance is less than 13 pixels, there
         * was a collision between the enemy and the player.
         */