[go: up one dir, main page]

0% found this document useful (0 votes)
21 views12 pages

Mini Project Final Report

Uploaded by

Anandu Murali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views12 pages

Mini Project Final Report

Uploaded by

Anandu Murali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

JAVA CHESS GAME

MINI PROJECT REPORT

Submitted by

ANANDU M K (9123104014)
ANNELIN RUBA S (9123104015)
ARAVIND RAM C S (9123104016)
ARAVINTH KUMAR P (9123104017)
ARNAV G P (9123104018)
ARUL PRASANTH A (9123104019)
NAVEEN RAMESH (9223104003)

in the partial fulfilment for the award of the degree of


BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE AND ENGINEERING

KCG COLLEGE OF TECHNOLOGY, KARAPAKKAM

(AUTONOMOUS)
1
BONAFIED CERTIFICATE

Certified that this Mini Project report titled “JAVA CHESS GAME” is the
Bonafide work of “ANANDU M K(9123104014), ANNELIN RUBA S(9123104015),
ARAVIND RAM CS(9123104016), ARAVINTH KUMAR P(9123104017),
ARNAV G P(9123104018), ARUL PRASANTH A(9123104019), NAVEEN
RAMESH(9223104003)”, who carried out the mini project to fulfill the requirements
of the course “23CS321 and Object Oriented Programming Laboratory”.

Dr. Cloudin S Ms. M.B.Anushlin Leena

HEAD OF THE DEPARTMENT COURSE FACULTY

Professor Assistant Professor


Dept. of CSE Dept. of CSE
KCG College of Technology KCG College of Technology
Karapakkam,Chennai Karapakkam,Chennai

2
INDEX

CHAPTER TITLE PAGE.NO


N.A ABSTRACT 4

1 INTRODUCTION
5

1.1 OVERVIEW OF THE PROJECT 5

1.2 OBJECTIVE 5

2 SYSTEM DESIGN
6

2.1 MODULES 6

2.2 SOFTWARE COMPONENTS 6


2.3 7
METHODOLOGY

3 SYSTEM DEVELOPMENT
9

3.1 IMPLEMENTATION
9

4 OUTPUT AND EXPLANATION


11

4.1 SCREEN SHOTS


11

5 CONCLUSION
12

3
ABSTRACT

This project introduces a sophisticated Java-based chess game that offers a


realistic and engaging gaming experience. The game's engine strictly
adheres to the official rules of chess, ensuring accurate move validation,
piece capture, check, checkmate, and stalemate detection. A user-friendly
GUI provides a visually appealing representation of the chessboard,
allowing players to easily select pieces and make moves.
To elevate the gaming experience, an AI opponent has been integrated into
the project. This AI is capable of playing at various difficulty levels,
adapting its strategies to match the skill of the human player. Whether
you're seeking a casual game or a challenging intellectual duel, the AI
opponent provides a formidable adversary.

4
CHAPTER 1

INTRODUCTION

1.1 OVERVIEW OF THE PROJECT

The project is a Java-based chess game. It provides a graphical user interface (GUI) for
playing chess, allowing users to interact with the board and pieces visually. The
Board class is a central component of the game, managing the game state, handling
user input, and drawing the board and pieces on the screen.

1.2 OBJECTIVES

The objectives of the Java Chess Game project are:

1. Create a functional chess game: Develop a game that accurately simulates the
rules of chess, allowing players to move pieces, capture opponents' pieces, and
achieve checkmate.
2. Provide a user-friendly interface: Design an intuitive and visually appealing
GUI that makes it easy for users to interact with the game.
3. Implement basic game mechanics: Include core functionalities like board
initialization, piece movement, turn management, and game state updates.
4. Ensure accurate rule enforcement: Ensure that the game strictly adheres to the
rules of chess, preventing illegal moves and detecting check and checkmate
conditions.
5. Offer a visually pleasing experience: Use appropriate graphics and animations
to enhance the visual appeal of the game.
6. Provide a challenging opponent: (Optionally) Develop an AI opponent that can
play at various difficulty levels, offering a competitive challenge to human
players.
7. Ensure smooth gameplay: Optimize the game's performance to minimize lag
and ensure a smooth playing experience.

These objectives aim to create a satisfying and engaging chess game that accurately
reflects the classic board game while providing a modern and enjoyable experience for
players

5
CHAPTER 2

SYSTEM DESIGN

2.1 MODULES

1. Chessgui:Contains the main classes and interfaces for the chess game GUI.
2. java.awt: Provides basic GUI components and functionality.
3. java.awt.event: Handles user input events like mouse clicks and key presses.
4. java.awt.geom: Provides geometric shapes and operations for drawing on the
screen.
5. java.awt.image: Represents and manipulates images.
6. java.io: Provides input/output operations for reading and writing files.
7. java.util:Contains various utility classes for collections, data structures, and
more.
8. javax.imageio: Provides API for reading and writing image files.
9. javax.swing: Provides advanced GUI components and functionality.

2.2 SOFTWARE COMPONENTS

The following software components are required for the Java Chess Game project:

Development Environment:

● Java Development Kit (JDK): This provides the necessary tools and libraries
for developing Java applications.
● Integrated Development Environment (IDE): An IDE like Eclipse, IntelliJ
IDEA, or NetBeans can streamline the development process by providing
features such as code editing, debugging, and project management.

2.3 HARDWARE COMPONENTS


The following shows the hardware components required for the Java Chess Project.
● Processor: Intel Core i3 or equivalent
● RAM: 4GB
● Storage: 2GB
● Graphics: Integrated graphics (e.g., Intel HD Graphics)

● Operating System: Windows 7 or later, macOS 10.10 or later, Linux

6
2.3 METHODOLOGY

1. Requirements Gathering and Analysis

● Identify stakeholders: Determine who will be using the game (e.g., casual
players, competitive players, children).
● Gather requirements: Collect information about the desired features,
functionality, and user experience.
● Create use cases: Define how users will interact with the game and what actions
they can perform.
● Prioritize requirements: Determine the most important features to focus on
initially.

2. Design

● System architecture: Define the overall structure of the game, including


components and their interactions.
● Class diagrams: Create diagrams to visualize the relationships between classes
and objects.
● User interface design: Design the layout, colors, and controls for the game's
interface.
● Algorithm design: Develop algorithms for game logic, such as piece movement,
capturing, and check/checkmate detection.

3. Implementation

● Coding: Write the Java code to implement the design, following best practices
and coding standards.
● Unit testing: Create unit tests to verify the correctness of individual components
and functions.
● Integration testing: Test how different components work together to ensure the
game functions as expected.

4. Testing

● Alpha testing: Test the game internally by the development team to identify and
fix bugs.
● Beta testing: Release the game to a limited group of external users for feedback
and testing.
● User acceptance testing (UAT): Test the game with representative users to
ensure it meets their needs and expectations.

7
5. Deployment

● Packaging: Create a distributable version of the game (e.g., JAR file).


● Deployment: Deploy the game to the desired platform (e.g., desktop, web,
mobile).
● Maintenance: Provide ongoing support, updates, and bug fixes after
deployment.

Additional Considerations

● AI development: If implementing an AI opponent, consider using algorithms


like minimax or alpha-beta pruning.
● Game balancing: Ensure that the game is challenging but fair for players of
different skill levels.
● Accessibility: Design the game to be accessible to users with disabilities.
● Scalability: If planning for a large user base, consider scalability factors like
performance and load balancing.

By following this methodology, you can effectively develop a Java Chess Game that
meets the requirements and provides a satisfying user experience.

8
CHAPTER 3

SYSTEM DEVELOPMENT
3.1 IMPLEMENTATION
package chessgui.pieces;

import chessgui.Board;

public class Piece {


private int x;
private int y;
final private boolean is_white;
private String file_path;
public Board board;

public Piece(int x, int y, boolean is_white, String file_path, Board board)


{
this.is_white = is_white;
this.x = x;
this.y = y;
this.file_path = file_path;
this.board = board;
}

public String getFilePath()


{
return file_path;
}

public void setFilePath(String path)


{
this.file_path = path;
}

public boolean isWhite()


{
return is_white;
}

public boolean isBlack()


{
return !is_white;
}

public void setX(int x)


{
this.x = x;
}

9
public void setY(int y)
{
this.y = y;
}

public int getX()


{
return x;
}

public int getY()


{
return y;
}

public boolean canMove(int destination_x, int destination_y)


{
return false;
}
}

10
CHAPTER 4

OUTPUT AND EXPLANATION

4.1 SCREEN SHOTS

11
CHAPTER 5

CONCLUSION
The written code demonstrates a solid foundation for a Java Chess Game. It
implements core functionalities for board initialization, piece placement, user
interaction, and basic game state management. Further analysis of the complete
codebase would be required to understand the full capabilities and potential
limitations of the game.

12

You might also like