GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Recognize combos

BreckenBrecken Posts: 143Member
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 Posts: 112Member
    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 Posts: 2,102PRO
    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.
This discussion has been closed.