Recognize combos

BreckenBrecken Member Posts: 143
edited December 2011 in Working with GS (Mac)
hi guys

We are working on a coin flip based game. And what I am stuck with is the following:
How do i make it recognise that it gets head or tail 2 times in a row. So if you flip HEAD, how do I get it to recognize if it flips heads again?

Thanks

Comments

  • muoch10muoch10 Member Posts: 112
    make two integer attributes. one called heads and one called tails.
    say when you flip heads change heads to heads +1. do the same thing with tails. Now say if heads is more then 0 and u flip tails, change heads to 0. and say if u flip heads and tails is more then 0 change tails to 0. Now when the attribute heads is 2 it means u flipped heads twice in a row, and when tails is two, u flipped tails twice in a row. You probably will want to reset heads and tails back to 0 when you flipped something twice so that you can do it again.
  • ozboybrianozboybrian PRO Posts: 2,102
    muoch10 seems about right.
    Basically when image = heads.
    Head boolean changes to true.
    Head integer changes from 0 to 1 (don't do + it can cause problems with bugs imo)
    If coin is flipped and image is head and head boolean is true change head integer to 2

    For the rest it'd just be if it was tails change head to false and tails integer to 1. etc.
    Just my version.
Sign In or Register to comment.