Spandu Java Report (1)
Spandu Java Report (1)
ADICHUNCHANAGIRI UNIVERSITY
FACULTY OF ENGINEERING, MANAGEMENT & TECHNOLOGY
BGS INSTITUTE OF TECHNOLOGY
Department of Computer Science and Engineering
(Approved by AICTE, New Delhi, Affiliated to ACU & Recognized byGovt. ofKarnataka)
BG Nagar – 571448, Nagamangala Taluk, Mandya.
Bachelor of Engineering
in
Computer Science and Engineering
Submitted by,
SINCHANA K 23CSE147
SPANDANA E L 23CSE148
CERTIFICATE
This is to certify that the Mini Project report entitled “BLOCK BLASTER” has been
successfully carried out by Ms.Sinchana K, [23CSE147], Ms.Spandana E L[23CSE148]
a bonafide student of BGS Institute of Technology, B.G Nagar in partial fulfillment of
requirements of degree of Bachelor of Engineering in Computer Science & Engineering of
Adichunchanagiri University, B.G Nagar during the year of 2024-25. It is certified that all
corrections/suggestions indicated for the internal assessment have been incorporated in the
report deposited in the department library. The Mini Project report has been approved as it
satisfies the academic requirements in respect of Mini Project work prescribed for the
Bachelor of Engineering Degree.
External Viva
1. 1.
2. 2.
ACKNOWLEDGEMENT
I would like to take this opportunity to thank a lot of eminent personalities, without whose
constant encouragement, this endeavor of mine would not have become a reality. At first, I
would like to thank the ADICHUNCHANAGIRI UNIVERSITY, for having this Project as
a part of its curriculum, which gave wonderful opportunity to work on my research and
presentation abilities and BGSIT for providing me with such excellent facilities, without
which, this project could not have acquired the shape it has now done.
I sincerely convey my regards and thanks to Dr. B N Shobha, BGSIT, BG Nagar,
Mandya, for giving me a chance to carry out and present my mini project work.
My sincere thanks to Dr. Shashikala S V, Professor & Head, CSE Department, BGSIT,
B G Nagar, Mandya, for giving me a chance to carry out mini project with all the support
and facilities.
I would like to thank Mrs. Kavyashree N, Assistant Professor, Department of CSE,
BGSIT, BG Nagar, Mandya, who stood as an excellent guide to carry out with our work
and has been always available as an expressive evaluator for the creation and correction of
the report towards my mini project. He has taken pain and time to go through my work
when needed.
My heartfelt gratitude to all the teaching and non-teaching faculties of Computer Science
and Engineering Department, BGSIT, BG Nagar, Mandya, for their support and
guidance towards the completion of my mini project work.
Finally, I would also extend my heartfelt thanks to my family members, classmates, friends
and well-wishers for their support and encouragement throughout this effort.
SINCHANA K 23CSE147
SPANDANA E L 23CSE148
i
ABSTRACT
The Block Blaster project is a 2D arcade-style shooting game developed using Java and its
built-in Swing library. The primary objective of the game is for the player to control a
horizontal shooter at the bottom of the screen and eliminate descending blocks by firing bullets.
As the player destroys blocks, their score increases, and the game continues until a block
successfully reaches the bottom of the screen, resulting in a game over. The game focuses on
basic but essential programming skills, such as GUI creation, object-oriented design, event-
driven logic, collision detection, and simple real-time animation.
This mini project is designed with the educational purpose of helping students and
beginner programmers apply theoretical concepts in a practical and enjoyable manner. Unlike
commercial games that require advanced frameworks and powerful hardware, Block Blaster is
lightweight, platform-independent, and does not require any third-party libraries—making it
easy to understand, implement, and run on any Java-supported system. The game's logic is
modular and well-structured, offering flexibility for further enhancements such as difficulty
levels, sound effects, and improved graphics.
Overall, Block Blaster demonstrates how fundamental Java programming knowledge can
be creatively applied to develop an engaging and functional desktop game. It not only serves as
an introduction to game development but also provides a solid base for exploring more
complex software and game-based applications in the future.
ii
TABLE OF CONTENTS
CONTENTS PAGE NO
ACKNOWLEDGEMENT i
ABSTRACT ii
TABLE OF CONTENTS iii
LIST OF FIGURES iv
Chapter 1: INTRODUCTION 1-6
1.1 Overview 1
1.2 ProblemStatement 2
1.3 Objectives 2-3
1.4 Existing System 3
1.4.1 Disadvantages 4
1.5 Proposing System 5
1.5.1 Advantages 5-6
iii
LIST OF FIGURES
iv
BLOCKBLASTER 2024-25
CHAPTER 1
INTRODUCTION
1.1 OVERVIEW
The Shooting Game (Block Blaster) is a simple, interactive 2D desktop game developed using
Java programming and the Swing GUI toolkit. This project is designed to demonstrate how
core programming concepts such as event handling, object-oriented design, graphical
rendering, and animation can be applied to create a fully functional application. In this game,
the player controls a shooter located at the bottom of the screen and must fire bullets to
destroy enemy blocks that continuously fall from the top. The objective is to eliminate as
many blocks as possible without letting them reach the bottom, while maintaining a high
score.
This mini project aims to serve both as a practical demonstration of Java capabilities
and as a foundational step for students or beginners interested in game development. It
focuses on simplicity, clarity, and efficiency, ensuring that the game can run smoothly on
basic computer systems without requiring external frameworks or advanced graphics libraries.
The game logic, including collision detection, score counting, and keyboard controls, is built
entirely using Java’s standard libraries.
The Block Blaster project is not only an entertaining game but also a strong learning
tool. It introduces real-time game loop mechanics, GUI management using Swing components
like J Frame and J Panel, and integrates user interaction through Key Listener events. This
project can be further expanded with sound effects, difficulty levels, multiplayer support, and
advanced graphics, making it a flexible and scalable platform for further learning and
innovation.
Built using Java’s Swing framework, the game presents a shooter at the bottom of the
screen which the player controls using keyboard input. Enemy blocks descend from the top at
regular intervals, and the player must shoot them down to score points and prevent them from
reaching the bottom of the screen. The core gameplay revolves around fast reflexes, simple
logic, and efficient interaction between game objects through events and collision detection.
This type of game not only encourages player engagement but also introduces the developer
to essential game mechanics and real-time application behavior.
There is a need for a simple, interactive, and educational game that can help learners
understand and implement core programming principles in a fun and engaging way. The
solution should involve real-time user interaction, basic animation, collision detection, and
scoring systems to give users a practical experience of developing a fully functional
graphical application.
To address this issue, this project proposes the development of a 2D Shooting Game
using Java, where the player controls a shooter to destroy falling enemy blocks. The game
must allow the player to choose different difficulty modes, respond to keyboard inputs for
movement and shooting, and handle game-over scenarios with a score-tracking system. It
should be built using Java Swing for GUI components and basic 2D graphics handling.
This project aims to provide an entertaining platform that not only serves as a
foundation for game development but also enhances the learner’s ability to design, code,
and implement object-oriented solutions using Java.
1.3 OBJECTIVES
1. To develop a simple 2D shooting game using Java and Swing:
Create an interactive game where the player controls a shooter to destroy falling enemy
blocks with bullets.
2. To enhance understanding of object-oriented programming (OOP) concepts:
Implement game features using Java classes, objects, inheritance, and encapsulation.
3. To provide an engaging way to learn GUI development in Java:
Use Java Swing components for rendering graphics, handling events, and updating the user
interface dynamically.
4. To implement real-time user interaction and event handling:
Capture keyboard inputs to control the shooter’s movement and bullet firing in real-time.
In the current landscape, various 2D shooting games are already available on multiple
platforms such as desktop, web, and mobile devices. These games range from simple
arcade-style shooters to more complex versions with advanced graphics, sound effects, and
multiplayer functionalities. Many existing systems are developed using powerful game
engines like Unity, Unreal Engine, or frameworks like LibGDX and Pygame, which offer a
wide range of tools and support for high-quality game development.
However, most of these existing systems are either too complex for beginners or too
heavy to run on low-end systems. They often require high system configurations and
include features beyond the scope of introductory or academic-level projects. Additionally,
they may not provide transparency into the underlying code structure, making it difficult for
learners to understand how the game mechanics work at a foundational level.
For academic and learning purposes, there is a lack of lightweight, customizable, and
beginner-friendly shooting games developed purely in Java using standard libraries like
Swing. Existing games often don't focus on demonstrating basic programming concepts or
providing educational value in terms of code clarity and modular structure.
The Block Blaster shooting game aims to address this gap by offering a simplified,
standalone desktop application that runs efficiently on basic hardware. It focuses on clarity,
ease of development, and educational purpose, making it ideal for students or beginners in
Java programming.
The existing system of the Fake News Detection Application covers all essential processes
involved in identifying and managing false information across digital platforms. It is
designed to serve various content categories such as politics, health, entertainment, and
current affairs, ensuring users can validate diverse types of news. The system will process
and analyze submitted content, classify it as real or fake, store detection results, track user
queries, and generate analytical reports. It supports real-time news verification, source
tracking, and decision-making for improving awareness and promoting accurate content
sharing.
1.4.1 DISADVANTAGES
The proposed system, titled Shooting Game (Block Blaster), is a lightweight, standalone 2D
arcade-style game developed using Java and its built-in Swing library. Unlike existing complex or
resource-intensive games, this system is specifically designed for educational purposes, providing
students and beginner programmers a platform to understand and apply core programming
concepts in a fun and interactive way.
The game allows a player to control a shooter that fires bullets to destroy descending
enemy blocks. The system is event-driven and utilizes Java Swing for creating the graphical user
interface. It incorporates essential game mechanics such as real-time animation, collision
detection, score tracking, and keyboard interaction. The modular design makes it easy to
understand, modify, and extend in future developments.
The proposed system is simple to install and run on any Java-supported operating system
without the need for external libraries or advanced hardware. It does not depend on any online
connectivity or third-party services, making it ideal for both offline use and classroom
demonstrations. Additionally, the structure of the program is organized in a way that encourages
object-oriented design and clean coding practices.
In the future, the system can be enhanced with sound effects, improved graphics, level
progression, and even network-based multiplayer functionality. Overall, the Block Blaster game
provides a strong foundation for learning while also delivering an enjoyable user experience.
1.5.1 ADVANTAGES
1. Interactive Learning Tool:
This project provides a hands-on way to learn Java programming by applying theoretical
concepts in a fun, practical environment.
The game helps reinforce object-oriented programming principles and GUI development using
Java Swing, both essential for software development.
Players experience real-time interaction with the game through responsive keyboard controls
and smooth game mechanics.
Implementing features like collision detection, score management, and input handling
boosts logical and analytical thinking.
The project can be easily enhanced with additional features like power-ups, sound effects,
or improved graphics, encouraging further development and experimentation.
This mini project is ideal for academic submission and can be added to a student’s
portfolio to demonstrate programming capabilities.
The game is built using only core Java and Swing, making it lightweight and easy to run
without installing third-party tools or frameworks.
9. Cross-Platform Compatibility:
As a Java application, the game can run on any operating system with a Java Virtual
Machine (JVM), ensuring wide compatibility.
CHAPTER 2
LITERATURE SURVEY
Game development using Java is a widely studied area in computer science education,
especially for beginners learning object-oriented programming and graphical user interfaces.
Various resources, tutorials, and prior academic mini-projects have provided strong
foundations in 2D game logic, collision detection, and interactive graphics. This project builds
upon that knowledge by designing a simple shooting game using Java Swing, intended to be
both educational and entertaining.
1. Oracle Java Documentation
Reference: https://docs.oracle.com/javase/
Abstract: The official Oracle Java documentation provides detailed explanations of Java
language syntax, Swing components, event handling, and threading. It served as a
foundational reference for implementing GUI components (JFrame, JPanel, KeyListener) and
understanding how to manage user input and real-time updates in the game.
CHAPTER 3
SYSTEM REQUIREMENT ANALYSIS
Server Requirements
The server system, if used, should be equipped with a minimum of an Intel Core i3
processor running at 2.4 GHz or higher, which is sufficient for managing application
deployment or handling backend services. At least 4 GB of RAM is recommended to ensure
smooth multitasking and handling of concurrent connections or processes. The server
should have a minimum of 10 GB of free disk space to store application files, logs, and any
user data such as high scores or game history. A stable network interface, such as Ethernet
or Wi-Fi, is essential if the game is to support online connectivity or multiplayer features.
Additionally, the server should run on a 64-bit operating system such as Windows, Linux, or
macOS, all of which are compatible with Java applications.
The client device, used by the player to run the game, should have at least an Intel Core i3
processor to handle Java execution and real-time gameplay. A minimum of 2 GB RAM is
required, although 4 GB is recommended for smoother performance, especially during
continuous gameplay. At least 500 MB of available storage is necessary to install Java (JDK
or JRE) and save game-related files. The device should support a display resolution of at
least 1024x768 pixels to ensure proper rendering of the game's graphical interface. A
standard QWERTY keyboard is required for user interaction, particularly for controlling the
shooter’s movement and firing bullets. The operating system must support Java, and may
Runtime Requirements
Operating System: Windows, mac OS, or Linux
Minimum Hardware:
Processor: Intel Core i3 or higher
RAM: 4GB minimum, 8GB recommended
Graphics Card: Integrated GPU sufficient for 2D graphics
Java Runtime Environment (JRE): Version 8 or later
CHAPTER 4
IMPLEMENTATION
4.1 SOURCE CODE:
package spandana;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Random;
public class ShootingGame extends JPanel implements KeyListener, ActionListener {
private int playerX = 300;
private final int playerWidth = 40, playerHeight = 40;
frame.setSize(600, 400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
g.setColor(Color.RED);
g.setColor(enemy.color);
g.fillRect(enemy.x, enemy.y, enemyWidth, enemyHeight); // Square enemies
}
g.setColor(Color.BLACK);
g.drawString("Score: " + score, 10, 20);
}
public void keyPressed(KeyEvent e) {
if (!gameStarted) {
if (e.getKeyCode() == KeyEvent.VK_1) { // Easy Mode
enemySpeed = 3;
enemySpawnRate = 2;
} else if (e.getKeyCode() == KeyEvent.VK_2) { // Medium Mode
enemySpeed = 5;
enemySpawnRate = 3;
} else if (e.getKeyCode() == KeyEvent.VK_3) { // Hard Mode
enemySpeed = 7;
enemySpawnRate = 5;
}
gameStarted = true;
timer.start();
}
if (gameOver && e.getKeyCode() == KeyEvent.VK_R) {
restartGame(); // Restart if game over
}
repaint();
}
public void keyReleased(KeyEvent e) {}
while (bulletIterator.hasNext()) {
Rectangle bullet = bulletIterator.next();
bullet.y -= 10;
if (bullet.y < 0) bulletIterator.remove();
}
// Add enemies randomly based on mode
if (random.nextInt(100) < enemySpawnRate) {
Color[] colors = {Color.BLUE, Color.GREEN, Color.ORANGE,
Color.MAGENTA};
CHAPTER5
RESULTS AND SNAPSHORTS
Main Menu
The game mode selection screen for your shooting game. Players are given three difficulty
options—Easy, Medium, and Hard—each mapped to a key press (1, 2, or 3). This is an
important part of your game’s user experience, as it allows players to adjust the challenge
level based on their preferences. You might consider refining this further by adding a brief
description of what each mode entails, such as how enemy behavior or firing speed changes
across difficulties.
Gameplay Screen
This image appears to show your shooting game in action! There's a player-controlled
entity—likely representing the shooter—along with enemy objects on the screen. The
background is solid, and the game elements are distinguishable. Your collision detection
and enemy spawning mechanics seem to be in place, which is great. If you're looking to
refine the game further, you might consider adding visual effects—such as explosions or
flashes—when a shot lands. Sound effects could also enhance player immersion.
SCORE Screen
This image shows an in-game moment from your shooting game-controlled shooter,
enemies, and bullets interacting in the game space. Your core mechanics—such as
shooting and enemy movement—seem functional. If you're looking to refine the
experience, you might consider tweaking enemy spawn rates, adjusting player movement
smoothness, or incorporating a scoring system to enhance engagement.
CONCLUSION
The Shooting Game (Block Blaster) project successfully demonstrates the application of core
Java programming concepts, particularly in the areas of graphical user interface design, event-
driven programming, and basic game development. Through this project, we have
implemented a fully functional 2D shooting game where the player controls a shooter,
eliminates falling enemy blocks, and aims to achieve a high score.
The project served as a valuable learning experience, enabling a practical
understanding of Java Swing components, keyboard input handling, collision detection, and
real-time animation. It also emphasized the importance of modular code design and efficient
resource management in application development. Despite some limitations, such as basic
graphics and the absence of sound or advanced AI, the game provides a strong foundation for
further development.
Overall, this mini project not only met its objectives but also opened up opportunities
for future enhancements such as multiplayer modes, score saving, advanced visuals, and
cross-platform support. It has proven to be an excellent stepping stone for exploring more
advanced topics in software and game development using Java.
FUTURE ENHANCEMENT
REFERENCES