SlideIt - a small game

mhc

Member
Licensed User
Longtime User
Hello to everybody,

the appended little application was written to trial the facilities of B4PPC.
I found B4PPC on the DVD of the magazine c't. Very good development tool!

The game is the old slide-game. Do you remember?
My first intention was to move the chips (token) as usual. But B4PPC has no possibility of mousemove-event on an image.
Filippo helped me with his great component fgControls which give you the possibility to add mouseevents (and much more) to the controls.

After all I followed an other strategy: I swap the image (the chip) directly when I click on it.
I added the option to select different kind of matrix (i.e. 3x3,4x4,...).
Another problem occured:
I create the chips dynamically with addimage during runtime.
With the dispose method I remove the images when I start a new game.
The same sub as before create the new chips (as images) with the same names. But we have now two click events on one image! And the game doesn't work anymore.
I found that is a bug of B4PPC :sign0148:
With a little dirty trick (using different names for the images) I solved this problem and now the game is running well.
(I don't know what is the effect to the memory demand).

Please try this little game. It would be nice to get some feedback.

In the source code I made a lot of comments. So we can follow the procedure.

mhc
 

Attachments

  • SlideIt.zip
    90.1 KB · Views: 281
Last edited:

Cableguy

Expert
Licensed User
Longtime User
Very nice indeed..

2 suggestions...
Add a sequence check so that the game Knows when it has finished...Otherwise it just waits for a next move...
With that acomplished, replacing the number with atual images is just a breeze and a lot of fun with the game...
If you need some isnpiration from a similar game... Search for the "Old forum" post...
there you will find a game called Pairs....made by me with a LOT of help from the Forum members...
 

mhc

Member
Licensed User
Longtime User
Now with a routine to recognize when finished

Hello Cableguy,

thanks for your suggestions.
The first one was not really a hard job. Now when all numbers in the right order a message appears. And the game is stopped (game over).

The second one needs more time to realize. Cause when I starting programming this little app my idea was that the user should be able to select an individual picture of his own storage. Than we cut this image in pieces depending on the selected matrix. And adding every piece to the corresponding image control. Just like a puzzle.
My spare time ends tomorrow so I need a few days to find a procedure for this job - without overdo the ressources of a PPC:confused:

The extended version of the game is uploaded (and updated) in my first post.

mhc
 
Top