๐Ÿงฉ PixelSlide โ€” 15-Puzzle Image Game with PixiJS

A premium sliding puzzle game built with PixiJS v8, Vanilla HTML5/CSS3/JavaScript, procedural canvas artwork, soundtrack integration, and a persistent local leaderboard.

PixiJS JavaScript CSS3 License


โœจ Features

  • ๐Ÿ–ผ๏ธ Custom Image Slicing:
    • Upload any image (PNG, JPG, WebP, GIF) via file picker or drag-and-drop.
    • Automatically center-crops and slices into grid tiles.
    • Comes with 4 built-in procedural gallery presets (Neon City, Deep Galaxy, Hex Prism, Aurora Peak) for instant offline play.
  • ๐ŸŽฎ 5 Difficulty Levels:
    • ๐Ÿ› Debug Mode (3ร—3): Starts from solved state and performs 5 non-reversing valid moves (guaranteed solvable in โ‰ค 5 moves).
    • ๐ŸŸข Easy (3ร—3): 8 tiles + 1 blank, 30 valid shuffle moves.
    • ๐Ÿ”ต Medium (4ร—4): Classic 15-puzzle (15 tiles + 1 blank), 100 valid shuffle moves.
    • ๐ŸŸฃ Hard (5ร—5): 24 tiles + 1 blank, 200 valid shuffle moves.
    • ๐Ÿ”ด Insane (6ร—6): 35 tiles + 1 blank, 400 valid shuffle moves.
  • โšก 100% Solvability Guarantee:
    • Shuffling simulates valid legal moves from the solved board state to ensure the puzzle is always solvable without parity issues.
  • ๐ŸŽจ Ultra-Smooth PixiJS v8 Rendering:
    • High-DPI canvas rendering with hardware acceleration.
    • 60FPS smooth lerp/easing tile sliding animations.
  • ๐ŸŽต Sound System & Soundtracks:
    • Background music (assets/sounds/backsound.mp3) with auto-looping and browser autoplay-policy handling.
    • Victory fanfare (assets/sounds/winner.mp3) upon solving.
    • Native Web Audio synthesizer for tile slides, clicks, and invalid move bumps.
    • Persistent sound toggle (๐Ÿ”Š / ๐Ÿ”‡).
  • ๐Ÿ† Persistent Leaderboard:
    • High scores saved in browser localStorage.
    • Filterable by difficulty (All, Debug, Easy, Medium, Hard, Insane).
    • Sorted by fastest completion time and least moves made.
  • ๐Ÿ’ก Helper Tools & Accessibility:
    • #๏ธโƒฃ Tile Numbers Toggle: Overlay numbering (1 to N-1) for challenging abstract images.
    • ๐Ÿ‘๏ธ Ghost Image Hint: Semi-transparent reference overlay of the full image.
    • โฑ๏ธ Millisecond-Precision Timer: Starts on the very first move.
    • ๐Ÿ”„ Quick Restart: Re-shuffle the same image and reset stats with one click.
    • โธ๏ธ Pause Modal: Stops the clock when taking a break.
    • ๐ŸŽ‰ Confetti Burst: Physics-based canvas confetti explosion on victory.

๐Ÿ“ Project Structure

eigen_vibe_code_competition/
โ”œโ”€โ”€ index.html              # Main HTML markup, HUD, modals, and screen containers
โ”œโ”€โ”€ style.css               # Cyber dark theme, glassmorphism, responsive grid, animations
โ”œโ”€โ”€ game.js                 # PixiJS v8 setup, puzzle engine, Web Audio, leaderboard logic
โ”œโ”€โ”€ assets/
โ”‚   โ””โ”€โ”€ sounds/
โ”‚       โ”œโ”€โ”€ backsound.mp3   # Looping background soundtrack
โ”‚       โ””โ”€โ”€ winner.mp3      # Victory celebration audio track
โ””โ”€โ”€ README.md               # Project documentation

๐Ÿš€ How to Run the Project

Since the project uses ES6 features and fetches audio assets / PixiJS canvas textures, it should be run through a local HTTP server.

If you have Python installed, run in your terminal:

# Python 3
python3 -m http.server 8080

Then open your browser at: ๐Ÿ‘‰ http://localhost:8080


Option 2: Node.js (npx serve or npx http-server)

If you have Node.js installed:

npx serve . -p 8080

or

npx http-server -p 8080

Then open http://localhost:8080.


Option 3: VS Code Live Server

  1. Open the project folder in Visual Studio Code.
  2. Install the Live Server extension (by Ritwick Dey).
  3. Right-click index.html and select "Open with Live Server".

๐ŸŽฎ Controls & Shortcuts

Input / Key Action
Mouse Click / Tap Slide adjacent tile into the blank slot
โ†‘ / W Move tile below blank upwards
โ†“ / S Move tile above blank downwards
โ† / A Move tile on right to the left
โ†’ / D Move tile on left to the right
N Toggle tile number overlays (#๏ธโƒฃ)
H Toggle ghost image hint (๐Ÿ‘๏ธ)
R Quick restart level (๐Ÿ”„)
M Toggle audio mute (๐Ÿ”Š/๐Ÿ”‡)
Esc Pause / Resume game (โธ๏ธ)

๐Ÿ› ๏ธ Technology Stack

  • Rendering Engine: PixiJS v8.20.0 via CDN
  • Structure & Logic: Vanilla HTML5, Vanilla JavaScript (ES6+ Classes)
  • Styling: Vanilla CSS3 (Custom Properties, Glassmorphism backdrop-filter, Flexbox, CSS Grid)
  • Typography: Google Fonts (Outfit, Inter)
  • Audio: HTML5 Audio API & Web Audio API Synthesizer
  • Storage: Browser localStorage API

๐Ÿ“ License

Distributed under the MIT License. Feel free to use and customize for your own projects!

S
Description
No description provided
Readme
1.3 MiB
Languages
JavaScript 54.4%
CSS 31.6%
HTML 14%