Flappy Bird app code
unknown
plain_text
a year ago
846 B
8
Indexable
//swing is a lightweight toolkit for creating java apps
//for creating GUI
import javax.swing.*;
public class App {
public static void main(String[] args) throws Exception {
//app window size
int boardWidth = 360;
int boardHeight = 640;
//creats game frame with top name
JFrame frame = new JFrame("Flappy Bird");
//frame.setVisible(true);
frame.setSize(boardWidth, boardHeight);
frame.setLocationRelativeTo(null);
frame.setResizable(false);
//after clink on X -> exits program
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
FlappyBird flappyBird = new FlappyBird(); //created object
frame.add(flappyBird);
frame.pack(); // for add frame except topLine
frame.setVisible(true);
}
}
Editor is loading...
Leave a Comment