import javax.imageio.ImageIO;
import java.awt.*;
import java.io.File;
import java.io.IOException;

public class Enemy {
    int x;
    int y;
    int w = 50;
    int h = 50;
    Image img;

    public Enemy(int x, int y) {
        this.x = x;
        this.y = y;
        try {
            img = ImageIO.read(new File("enemy.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void update() {
        // 敌机向下移动
        y += 2;
        if (y > 600) {
            y = -50;
        }
    }
}