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
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
Last edited: