The Sokoban Game

SokobanGame.hex (60.5 KB)


You can use the attached map editor to write your own map. At present, I am making more map enrichment games
The map editor is in a folder on github called “地图编辑器”

When you start the editor, you are prompted to enter the BMP number ↓

/ / 0 - > blank
/ / 1 - > wall
/ / 2 - > player
/ / 3 - > box
/ / 4 - > position
/ / 5 - > in the correct location of the box
// 6-> player standing on the tag
// each map size 16*16 can be added on its own

Enter the level you want to edit in this screen, such as 24↓

Since the map for 24 levels already exists, it will be loaded, and we’ll create a new level demonstration↓

We edited a new level
The “wsad” key controls the direction
“E” key to confirm
The “q” key selection box can refer to the BMP table above
The “o” key exports the archive
( Don’t try to press another key, I won’t say that the editor was changed from my old project, so… )

When you edit, don’t leave the edit area, or you may have an unknown error.

When the map is written, press the “O” key to export it
An option to select open mode will pop up
Select the text editor

Finally, copy and paste the map file to this location in the source code↓

2018/7/10 u8-15:00: add a level, now there are 32 levels
2018/12/30 :

  1. Game Map Changed from One-Dimensional Array to Two-Dimensional Array
  2. A key and left key press at the same time to reverse the color of the game screen
  3. New Cover
  4. Small menu contrast color

The source code :



Good rendering! I wonder what it takes…
However, some sprite of your character was not right…
The 2nd and 4th sprite was wrong–because no matter how you rotate a cube, the faces are in the same position as the first one (the back of them are slanted the wrong way)
and so is the box.
But other than that, pretty cool indeed.
One question, though:
This anything to do with @Mr.Blinky’s fancy rendering engine?
I am surprised for you to include some Chinese characters (assuming you draw them with lines and pixels)
Overall, a pretty good one.
Can you explain TAB?
I tried to find another word, but it didn’t work.
So there’s a like! :heart:

1 Like

You’re right. The label is where the box belongs :smiley:

The (isometric) rendering engine discussed in that topic is @DthEgn and not mine. I didn’t write an engine yet.

I like the semi 3D cubes approach. Would it be possible to add a birds eye view so you could scroll around the map? This would make solving the puzzle a lot easier.


A bird 's-eye view will be added in the future


Wow! This is so cool! :smiley: I love Sokoban! One of the inspirations for Circuit Dude.


A good first game, but the 3D perspective takes some getting used to.

The code could be improved though, there is a lot of redundancy and unnecessary nesting.
I.e. this:

} else {
  if (...) {

can be turned into:

} else if (...) {


Well, two sprites of the block dude is wrong. (perspective)
The perspective for the box is also wrong… (perspective)
The sprites you need to draw is on the right-bottom corner. Scaled it for convenience to read.
I also come up with a set of sprite for this top-down view. to avoid confusion, I decided to put arrows on top of the dude so you will not be confused.
I think they are not as good-looking, so I didn’t give you the bitmap. Ask me if you want them.

1 Like

Thank you. I’ll fix this soon

1 Like

But the bonding wall; Look, it looks like the 1 and 3 sprites are wrong

I think they are right…
Look, if you think they are wrong it is ok to not use them.
It is the direction that is not exact with your directions (left, down, right, up) instead of your (left, down, up, right)

I will be doing a overhaul of your game and fork your repository later.

I did some horizontal flips, which should be all right

Do NOT do horizontal flip on ManLeft and ManUp because those are correct :man_facepalming:
you should flip ManDown and ManRight…
Now horizontally flip everything (of yours) again and it should look very neat.

When I finished, I found out that I was wrong. You were right

You should use my sprites for the box, then. (because my new sprite for box is top-down view)
Your box is good.
But right now, my men look more handsome than yours…


It looks much better now



It CAN be done, but he is away for 3 years and I do not want to “help” him more than that. It was his project, despite being open source.
If you are asking if I am going to do it, no. It’s nowhere near my priority.

It’s really a pity that the development of this project has already stopped.
This early work has many problems, both in architecture and algorithm implementation.:thinking:
But anyway, put it down and thank all the players who used to love this game❤️

1 Like

Realistically speaking, I think it was quite all right.
Architecture is okay, and algorithm, while bad, works all right. It WORKS, and that is the thing that matter, to the end of the day. It run, without error, and as such people can have some fun playing it. It doesn’t matter if it is spaghetti code or if it is clean code.

Since my freshman year at Rensselaer Polytech Institute had ended, maybe I will gather the stuff I had and publish whatever I got.
No smooth scrolling, though. Take that as “hardware limitation”.