dorkhub

sokoban-rs

A sokoban with solver.

ShenMian
Rust799 forksApache-2.0updated 3 weeks ago
git clone https://github.com/ShenMian/sokoban-rs.gitShenMian/sokoban-rs

sokoban-rs

A sokoban with solver.

Features

  • Solver: The solver can automatically solve simple levels. More details.

  • Auto move: Supports full mouse control for automatic player movement and box pushing. More details.

  • Level management: Levels and solutions are stored in a database. More details.

  • Customization: Options can be customized via a configuration file. More details.

  • Map viewing: Supports moving and zooming the map. When switching levels, the zoom will automatically adjust to fit the window size.

  • Player character animation: The player character has smooth movement and animations in different directions.

  • Front-end and back-end separation: Backend code (such as solvers) is decoupled from the frontend (such as Bevy).

Acknowledgements

  • anian: Provided comprehensive answers to various questions and offered insightful suggestions.
  • @PaperPlaneLSY: Tested the project, improved the skin, and provided additional support.

Keymap

Mouse

Key Action
Click Left on player reachable area Move the character to this position
Click Left on a box Show the pushable area of the box
Click Left on box pushable area Push the selected box to this position
Hold Right and drag Adjust viewport
Click Button 4 Undo the last push
Click Button 5 Redo the last push
Scroll Middle Zoom in/out

Keyboard

Key Action
W/A/S/D Move the character
Arrow keys Move the character
[/] Switch to the previous/next level
Ctrl + [/Ctrl + ] Switch to the previous/next unsolved level
Ctrl + Z Undo the last push
Ctrl + Shift + Z Redo the last push
Esc Reset current level
-/= Zoom in/out
Ctrl + V Import levels from clipboard
Ctrl + C Export level to clipboard
P Toggle automatic solution
I Toggle instant move1
F11 Toggle fullscreen

Keyboard (Vim)

Key Action
H/J/K/L Move the character
U Undo the last push
Ctrl + R Redo the last push

Controller

Key Action
D-Pad Move the character
LB/RB Switch to the previous/next level
B/Circle Undo the last push
A/Cross Redo the last push
LT/RT Zoom in/out
Right stick Adjust viewport
X/Square Toggle instant move1
Y/Triangle Toggle automatic solution

License

Licensed under Apache License, Version 2.0.

Footnotes

  1. Disables character and box movement animations. 2

more like this

search

search projects, people, and tags