class Enemy {
    constructor() {
        this.x = 600;
        this.y = 300;
        this.w = 80;

        this.speed = 6;
    }

    show() {
        fill(235, 0, 0);
        ellipse(this.x, this.y, 25, 25);    // size and colour
    }

    update() {
        this.x -= this.speed;
        if (this.x < -50) {
            this.x = 750;            // makes it move and reset if needed
            this.y = random(0, 500);
        }
    }
    offscreen() {
        if (this.x < -this.w) {    // also helps move
            return true;
        } else {
            return false;
        }
    }
}