Skip to content

foxzool/jigsaw_puzzle

Repository files navigation

Jigsaw Puzzle Game

中文

A beautiful jigsaw puzzle game built with the Bevy game engine in Rust. Features dynamic puzzle generation, multiple difficulty levels, and smooth gameplay mechanics.

Game Screenshot

jig.mp4

Features

  • 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)

Getting Started

Prerequisites

  • Rust 1.70+ (2024 edition)
  • Cargo

Running the Game

# 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

Building for Web

# Install trunk for WASM builds
cargo install trunk

# Build and serve
trunk serve

Controls

  • PageUp / PageDown - Zoom in/out
  • Space - Show original image hint
  • H - Highlight matching puzzle pieces
  • Mouse - Drag and drop puzzle pieces

Project Structure

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

Development

# Run tests
cargo test --workspace

# Check code quality
cargo clippy
cargo fmt

# Run puzzle generator example
cargo run --example generator -p jigsaw_puzzle_generator

Assets

License

Licensed under either of

at your option.

About

jigsaw puzzle game made by bevy

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages