private static final int READY_HEIGHT = ImageMgr.ready.getHeight();
private static final int START_WIDTH = ImageMgr.start.getWidth();
private static final int BIRD_WIDTH = ImageMgr.bird[0].getWidth();
private static final int BIRD_HEIGHT = ImageMgr.bird[0].getWidth();
private static final int GROUND_HEIGHT = ImageMgr.ground.getHeight();
private static final int GAME_OVER_WIDTH = ImageMgr.gameOver.getWidth();
private static final int GAME_OVER_HEIGHT = ImageMgr.gameOver.getHeight();
private static final int BACKGROUND_HEIGHT = ImageMgr.background.getHeight();
private static Image offScreenImage;
private static Rectangle pipeRectangle1;
private static Rectangle pipeRectangle2;
private static Rectangle birdRectangle;
Cuckoo(){
setVisible(true);
setResizable(false);
//setTitle("cuckoo");
setBounds(L_X, L_Y,GAME_WIDTH,GAME_HEIGHT);
addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()){
case KeyEvent.VK_SPACE : start = true;break;
case KeyEvent.VK_ENTER : reopen();break;
}
}
@Override
public void keyReleased(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_UP) {
bird_y -= 20;
}
}
});
addWindowListener(new WindowAdapter() {