Calculator Community > Escheron: Shadow over Ragnoth

Picross (Clone)

<< < (2/7) > >>

Iambian:
I know it's a double post. Just got a screenshot going of what I have so far.

Geekboy1011:
epic looking although may i ask how you stored the info for the different tyle mars eg how it can tell weather its a x or a [] ( mark or marked with the x) as i just wonder if there is a better way then storing a byte map for each of them X.x

Iambian:
The way I do it is a rather roundabout way, since I built it using structures provided by the E:SoR menu system and rendering routines. I'm basically using a piece of the game's "textshadow" buffer as an array.

The way you should probably do it is to keep your table in something like a matrix or some 2D array. This table should be completely independent of the image you're supposed to be making, but... the contents of this array should be something like sprites where an empty tile would be... well. Empty. A [ ] tile would be some other value, and x tiles would be yet another value. When you go to compare the contents of the game area to the image you're supposed to be recreating, just recreate a binary of the image given your [ ] tiles versus your non-marked tiles. Non-marked would be 0 and [ ] tiles would be 1, where the x tiles would be ignored in the reconstruction of the image.

Should the image match what you have, then you've won the game. If you are trying to do something like a timer and penalize the player for incorrectly marking a tile as [ ], then you should try something like the following:

After you have reconstructed the image, compare it against the original in this manner:

(original xor playarea) and playarea

If there's any nonzero things as a result of that operation, then you know that a player tried to chisel out a tile in the wrong spot.

At any rate, and to attempt to answer your question...

I find it better to keep your images as a binary, and your play area as an array. Only when the array changes between a marked [ ] tile and an unmarked tile, should the array be silently converted in the background back to a binary file and compared directly between your source or solution image.

Geekboy1011:
awesome that helps a lot ty iambian ^_^

Iambian:
Changed the mid-border line to black. It was white. I think it looks better.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version