package flappyBrid01;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class BirdGame extends JPanel {
Bird bird;
Column column1, column2;
Ground ground;
BufferedImage backGround;
// 分数
int score;
// 标志游戏是否结束
// boolean gameOver;
BufferedImage gameOverImage;
BufferedImage startImage;
// 游戏状态
int state;
public static final int START = 0;// 常量名字大写
public static final int RUNNING = 1;
public static final int GAMEOVER = 2;
public BirdGame() throws Exception {
score = 0;
bird = new Bird();
column1 = new Column(1);
column2 = new Column(2);
ground = new Ground();
backGround = ImageIO.read(getClass().getResource("bg.png"));
// gameOver = false;
state = START;
gameOverImage = ImageIO.read(getClass().getResource("gameover.png"));