Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nermeenkamal/tic-tac-toe-game
Developed using Java and OpenGL
https://github.com/nermeenkamal/tic-tac-toe-game
java opengl
Last synced: 4 days ago
JSON representation
Developed using Java and OpenGL
- Host: GitHub
- URL: https://github.com/nermeenkamal/tic-tac-toe-game
- Owner: NermeenKamal
- License: mit
- Created: 2024-05-25T09:48:23.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-06-07T01:59:25.000Z (6 months ago)
- Last Synced: 2024-06-07T02:58:33.718Z (6 months ago)
- Topics: java, opengl
- Language: Java
- Homepage:
- Size: 500 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
---
# Tic-Tac-Toe Game
## Introduction
Tic-Tac-Toe is a classic two-player game where players take turns marking spaces in a 3x3 grid with their respective symbols, 'X' and 'O'. The objective is to form a line of three of one's own symbols either horizontally, vertically, or diagonally.
This project is an implementation of the Tic-Tac-Toe game using Java and the OpenGL (Open Graphics Library) for rendering graphics. The game features a graphical user interface, mouse input for player moves, and animations for the winning symbol.
## Features
- **Two-Player Gameplay**: Supports two players taking turns to place 'X' and 'O' symbols.
- **Winning Condition Detection**: Detects and announces when a player wins by forming a line of three symbols.
- **Draw Condition Detection**: Detects when the game ends in a draw.
- **Animated Winning Symbol**: Rotates the winning symbol to indicate the winning line.
- **Mouse Input**: Players interact with the game using mouse clicks.
- **Graphical Rendering**: Utilizes OpenGL for efficient and smooth graphics rendering.## Installation and Setup
### Prerequisites
- Java Development Kit (JDK) 8 or higher
- JOGL (Java Binding for the OpenGL API) library### Steps
1. **Clone the Repository**
```bash
git clone https://github.com/yourusername/tic-tac-toe.git
cd tic-tac-toe
```2. **Set Up JOGL Library**
- Download JOGL from the official website: https://jogamp.org/jogl/www/
- Add JOGL jars to your project's build path.3. **Compile and Run**
- Open the project in your favorite IDE (Eclipse, IntelliJ, etc.).
- Ensure the JOGL library is correctly referenced in your project.
- Run the `Render` class.## Project Structure
- `Tic_Tac_Toe/Render.java`: Initializes the OpenGL window and starts the game.
- `Tic_Tac_Toe/EventListener.java`: Handles the game logic, including player moves and win detection.
- `Tic_Tac_Toe/Graphics.java`: Provides methods for rendering images and handling graphics transformations.
- `Mouse/Mouse_Input.java`: Captures and processes mouse input from the player.
- `X_O_IMAGE/Image.java`: Represents an image resource loaded as an OpenGL texture.## Usage
- Run the `Render` class to start the game.
- Click on the grid to place your symbol ('X' or 'O').
- The game will detect and announce the winner or a draw.
- When a player wins, the winning symbol will rotate to highlight the winning line.## Contributing
Contributions are welcome! If you have any suggestions or improvements, feel free to open an issue or submit a pull request.
## License
This project is licensed under the MIT License. See the `LICENSE` file for more details.
---