
Help with ideas, best ways etc...
Quote:
> My problem is when the user selects a piece how do I control how the
> piece is placed on the board. ie if at start there is a double 6 on
> the board at x,y and the user selects a piece, say 6-3. How should I
> figure out which side the piece should go and in which direction. ie
> possible ways are;
[snip]Since it's a kind of a visual game, why not make the player able
to turn the piece the way (s)he wants? You can, by default, just stick
the piece somehow, clockwise might not be a bad idea (left->right,
up->down, right->left, down->up, depending if there's room or not).
You might use a struct to store the info:
typedef enum {
up, down, right, left
} DIR;
struct piece {
int value1, value2;
DIR direction;
};
Perhaps you want to make this a double linked list. That way you can
easily redraw the pieces if the system needs it, for example, or you
can backtrack them if you later decide to add an 'oops...' feature.
AriL
--
Seen on comp.lang.c:
Q: What does 'context' mean?
A: Depends on the context.