Academic Year: 2024-25: "Brick Breaker Game"
Academic Year: 2024-25: "Brick Breaker Game"
MSBTE, Mumbai.
1
DEPARTMENT OF COMPUTER ENGINEERING
S.S.M. ADSUL POLYTECHNIC COLLEGE,
CERTIFICATE
This is to certify that the micro project report entitled
Submitted by
Place: Ahmednagar
Date: / /2024-25
2
ACKNOWLEDGEMENT
We would also like to thanks principal Prof Gadakh R.S and Head of
Computer Department Prof Hole P.P we would also like to thank teaching staff of
Computer Department for helping us to achieve this goal.
3
INDEX
PART-I
1.0 Aims/Benefits of the Micro-Project 05
PART-II
1.0 Rationale 07-08
8.0 Conclusion 19
4
PART-I
2. Select the topic i.e. To Prepare a report on Create a Brick Breaker Game.
6. Following all the above methodologies we successfully completed our micro project.
5
4.0 Action Plan
2 Software JDK21 -
6
PART-II
Platform freelance – several languages area unit compatible with only 1 platform. Java was
specifically designed in order that it might run on any laptop, regardless if it had been running
Windows, Linux, Mac, UNIX operating system or any of the opposite software package.
Simple and simple to use – Java’s creators tried to style it therefore code can be written with
efficiency and simply. Java doesn't have some drawbacks. Since its automatic trash collection, it
will tend to use additional memory than alternative similar languages. There area unit typically
implementation variations on completely different platforms, that have LED to Java being delineated
as a “write once, check everywhere” system. Lastly, since it uses associate degree abstract “virtual
machine”, a generic java program doesn’t have access to native API’s on a system directory.
What is Listeners?
In Java, a listener is an object that receives and processes events, such as mouse clicks, key presses,
or window activation. Listeners are connected to an event object, which defines the event. For
example, a JButton or JTextField is an event source.
Here are some examples of listeners in Java:
• MouseMotionListener
Defines methods to receive notifications when the mouse is moved or dragged
• HttpSessionListener
Manages state or resources associated with a series of requests made in a Web application from the
same user or client
• ServletContextListener
Manages resources or state held at a VM level for the application
• MessageListener
An asynchronous event handler for messages that implements the MessageListener interface To
define a listener class, you implement a listener interface. When a listener method is invoked, it
receives an event that contains information about the event.
7
Here are some types of listeners in Java:
• Action Listener: Receives action events, such as a button or menu item click
• AdjustmentListener: Receives adjustment events, such as those emitted by a Scrollbar or
ScrollPane
• AWTEventListener: Receives notifications of events for objects that are instances of Component
or MenuComponent or their subclasses
• ComponentListener: Receives component events
• ContainerListener: Receives container events
• FocusListener: Receives keyboard focus events on a component
• ServletContextListener: Listens to startup and shutdown events of a context
8
2.0 Aims/Benefits of the micro project
Benefit Taken from this micro-project is understanding the concept of making a Brick Breaker
Game using java.
9
4.0 Actual Methodology Followed/Program Code
import javax.swing.*;
java.awt.event.*; class
brickLayout[][]; public
int brickHeight;
brickLayout[i][j] = 1;
(brickLayout[i][j] > 0) {
g.setStroke(new BasicStroke(4));
g.setColor(Color.BLACK);
10
}
brickLayout[row][col] = value;
private int totalBricks = 21; private Timer timer; private int delay =
int ballPosY = 350; private int ballXDir = -1; private int ballYDir =
setFocusable(true);
setFocusTraversalKeysEnabled(false);
timer.start();
// Background color
g.fillRect(0, 0, 3, 592);
g.fillRect(691, 0, 3, 592);
11
g.fillOval(ballPosX, ballPosY, 20, 20);
g.setColor(Color.black);
0;
g.setColor(new Color(0XFF6464));
isPlaying = false;
ballXDir = 0;
ballYDir = 0;
g.setColor(Color.BLACK);
g.dispose();
@Override
{ timer.start(); if (isPlaying) {
12
8))) {
ballYDir = -ballYDir;
brickMap.brickHeight;
(ballRect.intersects(brickRect)) { brickMap.setBrickValue(0,
ballXDir = -ballXDir;
else {
ballYDir = -ballYDir;
ballPosX += ballXDir;
ballPosY += ballYDir;
if (ballPosX < 0) {
ballXDir = -ballXDir;
13
}
if (ballPosY < 0) {
ballYDir = -ballYDir;
ballXDir = -ballXDir;
repaint();
@Override
@Override
if (arg0.getKeyCode() == KeyEvent.VK_RIGHT)
if (arg0.getKeyCode() == KeyEvent.VK_LEFT)
} else { moveLeft();
if (arg0.getKeyCode() == KeyEvent.VK_ENTER) {
if (!isPlaying) {
14
ballXDir = -1; ballYDir = -2;
playerScore = 0; totalBricks =
isPlaying = true;
playerX += 50;
isPlaying = true;
playerX -= 50;
@Override
frame.setTitle("Brick Breaker");
frame.setResizable(false);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(gamePanel); } }
15
5.0 Outputs of the Micro-Projects
16
6.0 Actual Resources Use
Sr. no. Name of resource material Specifications Quantity
2 Software JDK21 -
17
7.0 Skill Developed
1. Teamwork
2. Communication skills 3.
Problem-solving skills.
4. Creativity.
8.0 Conclusion
Building a Brick Breaker game in Java is a fun and educational project for aspiring game developers.
It covers essential game development concepts and provides a foundation for more complex game
projects in the future. Roll up your sleeves, start coding, and have a blast developing your own Brick
Breaker game!
18
ANNEXURE II
Evaluation Sheet for the Micro Project
Academic Year : 2024-2025
Sr. Student Name Marks out of 6 for Marks out of 4 for Total
No. performance in performance in oral/ out of
presentation (D5 10
group activity (D5
Col.9)
Col. 8)
1 KADYAL RAJESHWARI P.
2 SHINDE SRUSHTI A.
3 SHINDE SIDDHI S.
4 DONGARE VAISHNAVI R.
19