![]() This program requires a sound file in the directory ![]() of rows can control the button heightĭisplay.addMouseListener(new MouseSensor()) ĭisplay.addMouseMotionListener(new MouseSensor()) ![]() JLabel livesLbl = new JLabel(" Lives: ") ĬtPreferredSize(new Dimension(133,550)) //Not exact, to account for borderingĬtBackground(Color.LIGHT_GRAY) ĬtLayout(new GridLayout(25,1)) //The no. ![]() JLabel scoreLbl = new JLabel(" Score: ") tHorizontalAlignment(SwingConstants.CENTER) This part should be quite familiar by nowįtDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ĭtPreferredSize(new Dimension(500,550)) Public static Timer time = new Timer(20,new Ticker()) Public static int xPos = 250, score = 0, lives = 3 Public static JPanel controls = new JPanel() Public static JPanel display = new DisplayPanel() I am trying to store the bricks in an array, so I could just remove it from the array, when it is hit by the ball. I cannot figure out how to make the bricks disappear after they are hit by the ball. I have implemented how to make the ball bounce of the walls and first row of bricks. I have already created the ball, the paddle and the bricks. ![]() I have seen the answers but not quite works for me. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |