Welcome to The Akari Puzzle Game, a JavaFX-based implementation of the classic logic puzzle "Akari" (also known as "Light Up"). This game challenges you to place lamps strategically on a grid to illuminate corridors while adhering to specific rules. With a sleek user interface and a collection of puzzles ranging in difficulty, this game offers hours of brain-teasing fun!
- Overview
- User Interface
- Features
- Game Rules
- Controls
- Scenes
- How to Play
- Puzzle Library
- Technical Details
- How to Run
- Development
- Credits
- License
The Akari Puzzle Game is a single-player logic puzzle where the objective is to place lamps on a grid to light up all corridors without violating specific rules. The game features a variety of puzzles with different sizes and difficulties, providing a challenging and engaging experience for players. The user interface is designed to be intuitive and visually appealing, with interactive controls and dynamic feedback to guide players through the puzzles.
The game follows the Model-View-Controller (MVC) architecture, with separate classes for managing the game state, rendering the user interface, and handling user input. The game logic ensures that puzzles are solved correctly according to the rules of Akari, providing a satisfying experience for players of all skill levels.
- Intuitive Interface: Navigate through puzzles with a user-friendly design.
- Puzzle Library: Includes a variety of puzzles ranging from easy to challenging.
- Interactive Controls: Navigate between puzzles, reset your progress, and get hints.
- Dynamic Feedback: Visual indicators for lit cells, clue satisfaction, and illegal lamps.
- Game State Validation: Ensures puzzles are solved correctly according to Akari rules.
- Hints System: Provides guidance to help you solve difficult puzzles.
- Place lamps on empty cells (
CORRIDOR
) to light up the entire grid. - A lamp illuminates all cells in its row and column until blocked by a wall or clue.
- Clues (numbered cells) indicate the exact number of adjacent lamps.
- No two lamps can illuminate each other (i.e., no two lamps can be in the same row or column unless separated by a wall).
- The puzzle is solved when:
- All corridors are lit.
- All clues are satisfied.
- No illegal lamps exist.
- Start Game: Begin solving puzzles.
- Instructions: Learn the rules and mechanics of the game.
- Exit: Exit the application.
- Next Puzzle: Load the next puzzle in the library.
- Previous Puzzle: Return to the previous puzzle.
- Random Puzzle: Load a randomly selected puzzle.
- Reset Puzzle: Reset the current puzzle to its initial state.
- Hint: Get a hint to guide your progress.
- Left-Click on a
CORRIDOR
cell to place a lamp or remove an existing lamp.
The first screen the user sees:
- Provides options to start the game, view instructions, or exit.
- Features a sleek design with a title and styled buttons.
The main gameplay interface:
- Displays the puzzle grid, control buttons, and puzzle information.
- Highlights cells lit by lamps and provides real-time feedback on clue satisfaction.
Provides detailed guidance on how to play:
- Explains the rules and controls.
- Accessible at any time during gameplay.
- Start the Game: Launch the application and click "Start Game" on the welcome screen.
- Select a Puzzle: Use the control buttons to navigate between puzzles. Use
Random Puzzle
to load a random challenge. - Place Lamps: Click on empty corridor cells to place lamps and illuminate the grid.
- Check Clues: Ensure all clue cells are satisfied with the correct number of adjacent lamps.
- Solve the Puzzle: Once all cells are lit, all clues are satisfied, and no illegal lamps exist, the puzzle is solved!
- Next Challenge: Advance to the next puzzle or try a random one.
- Get Hints: Use the hint button to receive guidance on difficult puzzles.
- Enjoy the Game: Have fun solving puzzles and challenging your logical thinking!
The game includes 25 preloaded puzzles ranging in size and difficulty. Each puzzle is carefully designed to challenge your logical thinking. More puzzles can be added via the SamplePuzzles
class.
- Model-View-Controller (MVC): Ensures clean separation of concerns.
- Model: Manages the state of the game, including the active puzzle and its properties.
- View: Renders the user interface, including the puzzle grid and controls.
- Controller: Handles user input and updates the model and view accordingly.
AppLauncher
: The entry point of the application, manages scenes and stage.ControllerImpl
: Implements the game logic and updates the model based on user input.ModelImpl
: Represents the game state and validates puzzle conditions.PuzzleView
,ControlView
,MessageView
: Render the puzzle grid, control buttons, and dynamic messages.SamplePuzzles
: Contains preloaded puzzles for the game.Main
: Contains the main method to launch the application.
AlternateMvcController
: Defines the methods for handling user input and updating the game state.ClassicMvcController
: ExtendsAlternateMvcController
and adds methods for managing the game state.Model
: Defines the methods for managing the game state and validating puzzle conditions.Puzzle
: Represents a single puzzle with a grid, clues, and solution.PuzzleLibrary
: Contains a collection of puzzles and methods for accessing them.FXComponent
: Represents a JavaFX component with methods for initializing and updating the view.
- Java 17+: Core programming language for the application.
- JavaFX: Used for the user interface and event handling.
- JUnit 4: For unit testing the model and controller logic.
- Mockito: For mocking dependencies during testing.
- Java Development Kit (JDK) version 17 or later.
- Maven for dependency management (optional).
- Clone the repository:
git clone https://github.com/hoangsonww/Akari-Puzzle-Game-JavaFX.git
- Navigate to the project directory:
cd Akari-Puzzle-Game-JavaFX
- Build and run the project:
Alternatively, you can run the
mvn javafx:run
AppLauncher
class directly from your IDE, if you are using IDEs like IntelliJ IDEA or Eclipse and have JavaFX configured.
- Open the
SamplePuzzles
class. - Add a new 2D integer array representing the puzzle grid.
- Register the new puzzle in the
PuzzleLibrary
withinAppLauncher
.
- Modify the
main.css
file to customize the appearance of the application. - Use of CSS styles to change colors, fonts, and layout properties.
- Run the JUnit 4 test suite to validate the functionality:
mvn test
- Test cases cover model logic, controller actions, and game state validation.
- Alternative: Run individual test classes directly from your IDE.
- Developer: Son Nguyen
- Icon: Freepik via Flaticon.
- Puzzle Design: Inspired by the classic logic puzzle "Akari" (Light Up).
This project is licensed under the MIT License. See the LICENSE
file for details.
Created with β€οΈ by Son Nguyen in 2024.