Move the crate

Hello everyone.

Finaly managed to actually finish a tiny game. Its a simple sokoban clone.
Developed under Linux in Code::Blocks.

Windows binary available in attachments. ( Hope they will work. )

Source code available here.
Download source code here.

To compile the game use CODE::BLOCKS.

Compiling under Linux:
Use script to build your game directory before running the game.
This scripts uses Imagemagick convert to convert GIMP XCF files to bitmaps.
Also copies all required files to the directories they need to be when the game runs.



Nice! I used the windows binary, it worked great. I liked the graphics, and everything went pretty smooth. I really appreciated the scale factor option in the settings menu. I got all the way to level 17 before things got a little too hard for me. I should say though that levels 1-10 were too easy, and things only got interesting around level 13. In terms of improvements... perhaps an undo system might be an option (perhaps max number of undo's per level?). Also, it'd be a big quality-of-life improvement if you allowed keyboard menu input, e.g to advance to the next level. Might be nice to have a sokoban solver to tell you when you're in an impossible state, but that might be a bit too much work.

I tried the editor, but one thing I noticed missing is the ability to select alternate tiles for the floor (e.g. there are some tiles with floorboards missing). Maybe I missed something.

Good job!

Izual said:

Developed under Linux in Code::Blocks.

Can't think of a more appropriate IDE to develop this game in ;D


Thank you for trying it out. I was expecting a crash or two or perhaps a missing dll, so i am actually pleased to hear that there were no problems running the game.

The first 10 levels are there just to be there. I made them in a hurry to meet the quota of 20 levels for release i set for myself. :)
There is a plan to make more levels for future releases. And of course, more challenging.

Undo should be easy to implement but the "solver" is another thing.
Keyboard input for menu is also planed for future releases.

In editor you can use mouse wheel to scroll trough all the floor "decoration" tiles or mouse wheel press to delete / add random floor decoration.


I don't like GUIs/IDEs so I hacked up these simple makefiles to build from the command line. :-/

1.PHONY: all clean 2 3all clean: 4 $(MAKE) -C game-source-code $(MAKECMDGOALS)

1.PHONY: all clean 2 3ALLEGRO_LIBS = allegro-5 allegro_dialog-5 allegro_font-5 allegro_image-5 4CFLAGS = -Iinc -Wall $$(pkg-config --cflags $(ALLEGRO_LIBS)) 5CC = gcc 6GAME = ../bin/move-the-crate 7HEADERS = $(wildcard inc/*.h) 8LIBS = $$(pkg-config --libs $(ALLEGRO_LIBS)) 9SOURCES = $(wildcard src/*.c) 10OBJECTS = $(patsubst %.c,%.o,$(patsubst src/%,../bin/%,$(SOURCES))) 11 12ifdef DEBUG 13 CFLAGS += -g3 -O0 14else 15 CFLAGS += -O2 16endif 17 18all: $(GAME) 19 20clean: 21 rm -fR $(GAME) $(OBJECTS) 22 23$(GAME): $(OBJECTS) 24 $(CC) $(CFLAGS) -o $@ $? $(LIBS) 25 sh ../scripts/ 26 27%.c: %.o 28 29../bin/%.o: src/%.c $(HEADERS) 30 $(CC) $(CFLAGS) -c -o $@ $<

The game expects you to run from the generated "bin" directory so I also created a to go with it:
1#!/bin/sh 2cd bin && ./move-the-crate

The game is nostalgic because it reminds me of Chip's Challenge from the DOS days, and probably other related games. It's a nicely polished first game!

Edgar Reynaldo

Congratulations on a functional game. ;)

It would be nice to have the interface completely thru the keyboard, or the mouse, but mixing the two slows the game and breaks up the feel.

I played to level 12 before it started to get very difficult.

One thing I noticed, is that creating a triply scaled window breaks the game. The controls and the title bar go off the top of the screen and you cant get them back. More graphics modes might be nice.

The 'X' button in the window doesn't close the game. Catch the ALLEGRO_EVENT_DISPLAY_CLOSE event to act on the close button.

If you get time, a little bg music or sound fx might be cool too.

EDIT - It should be "available", not "aviable" for the level info.

Thanks for letting me play. ;)


Hello again.

Updated version of this little game called "Move the crate" can be found here. Or as an attachment to this post.

Source code available here.

What is new:
- Lots of keyboard controls in menu, gameplay and also some in editor.
- Confirmation to keep changed window size.
- Undo! Yes, you can undo your last 100 moves now.

bamccaig said:

I don't like GUIs/IDEs so I hacked up these simple makefiles to build from the command line. :-/

One day i will have to learn the magic of makefiles so i can keep everyone happy.
Thank you for your effort in making one.

Thank you everyone for testing it out and all your suggestions.

Thread #617187. Printed from