A beautiful jigsaw puzzle game built with the Bevy game engine in Rust. Features dynamic puzzle generation, multiple difficulty levels, and smooth gameplay mechanics.
jig.mp4
- Multiple Puzzle Sizes: Choose from 20 to 500 pieces
- Two Game Modes: Classic jigsaw shapes or square pieces
- Dynamic Puzzle Generation: Built-in puzzle piece generator
- Smooth Interactions: Drag and drop puzzle pieces with visual feedback
- Helpful Features: Original image preview, piece matching hints
- Cross-platform: Runs on desktop and web (WASM)
- Rust 1.70+ (2024 edition)
- Cargo
# Clone the repository
git clone https://github.com/foxzool/jigsaw_puzzle.git
cd jigsaw_puzzle
# Run the game
cargo run
# For optimized build
cargo run --release
# Install trunk for WASM builds
cargo install trunk
# Build and serve
trunk serve
- PageUp / PageDown - Zoom in/out
- Space - Show original image hint
- H - Highlight matching puzzle pieces
- Mouse - Drag and drop puzzle pieces
This project consists of two main components:
- Main Game: The Bevy-based puzzle game with UI and gameplay
- Puzzle Generator: A standalone library (
jigsaw_puzzle_generator
) for creating puzzle pieces from images
# Run tests
cargo test --workspace
# Check code quality
cargo clippy
cargo fmt
# Run puzzle generator example
cargo run --example generator -p jigsaw_puzzle_generator
- Images from Unsplash
- Icons from Flaticon
- Fonts from Font Space
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.