[messages] Edit: Re: [Module Design] Randomizing game piece images.
taruss2000 at gmail.com
Fri Oct 18 12:10:08 MST 2013
On Thu, Oct 17, 2013 at 9:40 AM, plloyd1010 <plloyd1960 at gmail.com> wrote:
> The second problem is probably somewhat easier. I want create a stack of
> double sided pieces, draw one random piece, then get a random side (like
> a coin flip). I know I start with a randomized deck of the pieces, but
> don't know how to flip the piece.
Well rather than get a random side, you could just double the number of
pieces in the deck.
What you would do is to have your pieces with
Piece 1: Side A / Side B
Piece 2: Side A / Side B
Piece 3: Side A / Side B
and then just add
Piece 1a: Side B / Side A
Piece 2a: Side B / Side A
Piece 3a: Side B / Side A
then what you draw is already what you want.
(I assume you will still want to be able to flip the drawn pieces between
side A and B. If you don't need that, it becomes even easier.)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the messages