Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import static utils.Constants.WINDOW_WIDTH;
- import static utils.Constants.WINDOW_HEIGHT;
- import static utils.Constants.LB_BACKGROUND;
- import static utils.Constants.CELLS_IN_COL;
- import static utils.Constants.CELLS_IN_ROW;
- import static utils.Constants.CELL_SIZE;
- import utils.DrawCell;
- import utils.DrawLine;
- import utils.Updater;
- import java.awt.Color;
- import java.awt.Dimension;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import java.awt.event.WindowAdapter;
- import java.awt.event.WindowEvent;
- import java.util.Arrays;
- import java.util.List;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import javax.swing.ImageIcon;
- public class LevelBuilder extends JFrame {
- public LevelBuilder() {
- super("Level Builder");
- setResizable(false);
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setIconImage(new ImageIcon("assets/level-builder-logo.png").getImage());
- setLayout(null);
- getContentPane().setBackground(LB_BACKGROUND);
- getContentPane().setPreferredSize(new Dimension(WINDOW_WIDTH, WINDOW_HEIGHT));
- pack();
- for (int horLine = 0; horLine < CELLS_IN_COL; horLine++) {
- add(new DrawLine(0, CELL_SIZE * horLine, WINDOW_WIDTH, CELL_SIZE * horLine, 10));
- }
- for (int verLine = 0; verLine < CELLS_IN_ROW; verLine++) {
- add(new DrawLine(CELL_SIZE * verLine, 0, CELL_SIZE * verLine, WINDOW_HEIGHT, 10));
- }
- setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment