Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Move the crate

This thread is locked; no one can reply to it. rss feed Print
Move the crate
Izual
Member #2,756
September 2002
avatar

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 build-game-directory.sh 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.

Screenshots:
{"name":"611160","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/b\/eb145a5d4d0c083700f658f90cf2e38f.png","w":640,"h":480,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/b\/eb145a5d4d0c083700f658f90cf2e38f"}611160
{"name":"611161","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/0\/403b56906c54f88686bf5c400397461a.png","w":640,"h":480,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/0\/403b56906c54f88686bf5c400397461a"}611161
{"name":"611162","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/f\/cf396fe78808c3baebc94cce783e41c0.png","w":640,"h":480,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/f\/cf396fe78808c3baebc94cce783e41c0"}611162

SiegeLord
Member #7,827
October 2006
avatar

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

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Izual
Member #2,756
September 2002
avatar

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.

bamccaig
Member #7,536
July 2006
avatar

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

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

game-source-code/Makefile#SelectExpand
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/build-game-directory.sh 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 launcher.sh to go with it:

launcher.sh#SelectExpand
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
Major Reynaldo
May 2007
avatar

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. ;)

Izual
Member #2,756
September 2002
avatar

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.

Go to: