-1

im trying to make a simple game on cocos2d box2d, its basically got two buttons and a label with the points. the points increment by +1 every second.

what im trying to do is, the player taps both buttons sequentially so it has to be 'button1' then 'button2' then 'button1' then 'button2' ..... if this is done properly then the points increment speed should increase, and the faster the buttons are tapped sequentially, the faster the points should increase.

how can i go about doing this? any ideas?

sahil
  • 141
  • 1
  • 9

1 Answers1

0

The idea is simple: you only increment the score when the other button was the last pressed button. That's it. So:

  1. Keep track of the last pressed button.
  2. If button1 is pressed, and button2 was not the last pressed button, don't do anything, otherwise increment the score by some amount.
  3. Do the same kind of check for button2.

Does this make sense?

Ken Toh
  • 3,721
  • 1
  • 24
  • 30