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 ↓
CJJ)%25KK9C%5B%60~O6MP%5DIY30%5B9

/ / 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↓
~23L1)2S7NA%5DSK)M%60~B%40V3P

Since the map for 24 levels already exists, it will be loaded, and we’ll create a new level demonstration↓
B%7D~%407XOBL%60TGQU%5BJIHGE%24%5D4

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.

%5D%5BUY6%40SXT%7D_%25LK~%40UT)%7DL%5BL
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
%7D8EZQ3E%5DG4ALD57XCO)%40SUK
QQ%E6%88%AA%E5%9B%BE20180710152527

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
    1

The source code : https://github.com/createskyblue/Sokoban

ProjectABE: https://felipemanga.github.io/ProjectABE/?url=http://raw.githubusercontent.com/createskyblue/Sokoban/master/build.hex

7 Likes

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.

3 Likes

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

2 Likes

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

2 Likes

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 (...) {

E.g.
https://github.com/Pharap/Sokoban/commit/689c8fba863f03e3b038d555c96fab93cebfb2a0

@LHW
Well, two sprites of the block dude is wrong. (perspective)
The perspective for the box is also wrong… (perspective)
Blockdude
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

lol…
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…

%7BRU(KS%40(M7H%7DXB)L_Z42_MQ

It looks much better now

2 Likes

感觉视觉中心突然跳转太突兀了,尝试搞个画面延迟平移,一段时间无按键事件后切换视觉中心

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.
是的。这可以被做到,但是他已经3年没来了,我也不想再多帮他。这是他的事,虽然这是开源项目。
如果你在问我会不会去加这个功能,我会说不。因为这对我来说不重要,我也还有其他事要做。

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”.