[messages] Edit: Re: [Module Design] Randomizing game piece images.

Tom Russ 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...
URL: <http://www.vassalengine.org/pipermail/messages/attachments/20131018/4cb1aa18/attachment.html>


More information about the messages mailing list