Akari-Puzzle-Game-JavaFX

The Akari Puzzle Game in JavaFX

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!

Table of Contents

Overview

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.

User Interface

Welcome Screen

Welcome Screen

Game Screen

Game Screen

Instructions Screen

Instructions Screen

Puzzle Solved

Puzzle Solved

Hints

Hint System

Features

Game Rules

  1. Place lamps on empty cells (CORRIDOR) to light up the entire grid.
  2. A lamp illuminates all cells in its row and column until blocked by a wall or clue.
  3. Clues (numbered cells) indicate the exact number of adjacent lamps.
  4. 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).
  5. The puzzle is solved when:
    • All corridors are lit.
    • All clues are satisfied.
    • No illegal lamps exist.

Controls

Buttons

Mouse Interactions

Scenes

Welcome Scene

The first screen the user sees:

Game Scene

The main gameplay interface:

Instructions Scene

Provides detailed guidance on how to play:

How to Play

  1. Start the Game: Launch the application and click “Start Game” on the welcome screen.
  2. Select a Puzzle: Use the control buttons to navigate between puzzles. Use Random Puzzle to load a random challenge.
  3. Place Lamps: Click on empty corridor cells to place lamps and illuminate the grid.
  4. Check Clues: Ensure all clue cells are satisfied with the correct number of adjacent lamps.
  5. Solve the Puzzle: Once all cells are lit, all clues are satisfied, and no illegal lamps exist, the puzzle is solved!
  6. Next Challenge: Advance to the next puzzle or try a random one.
  7. Get Hints: Use the hint button to receive guidance on difficult puzzles.
  8. Enjoy the Game: Have fun solving puzzles and challenging your logical thinking!

Puzzle Library

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.

Technical Details

Architecture

Key Classes

Key Interfaces

Dependencies

How to Run

Prerequisites

Steps

  1. Clone the repository:
    git clone https://github.com/hoangsonww/Akari-Puzzle-Game-JavaFX.git
    
  2. Navigate to the project directory:
    cd Akari-Puzzle-Game-JavaFX
    
  3. Build and run the project:
    mvn javafx:run
    

    Alternatively, you can run the AppLauncher class directly from your IDE, if you are using IDEs like IntelliJ IDEA or Eclipse and have JavaFX configured.

Development

Adding New Puzzles

  1. Open the SamplePuzzles class.
  2. Add a new 2D integer array representing the puzzle grid.
  3. Register the new puzzle in the PuzzleLibrary within AppLauncher.

Styling

Unit Testing

Credits

License

This project is licensed under the MIT License. See the LICENSE file for details.


Created with ❤️ by Son Nguyen in 2024.