playMaker

Author Topic: [SOLVED] How do you store the amount of taps on screen?  (Read 1472 times)

sinman

  • Playmaker Newbie
  • *
  • Posts: 14
    • View Profile
[SOLVED] How do you store the amount of taps on screen?
« on: July 04, 2012, 12:37:45 AM »
Say I have a cube in the game scene, and it needs to be tapped 5 times to change into a sphere. How can I go about doing this?

I have created a Int variable to store the number of taps (TapNumber).
I have created a Int variable of the number of taps to reach (in the case above, 5) called NumOfTaps
I have created a boolean operator of Int Switch where it compares the TapNumber variable to the Num of Taps.

All I seem to be missing is the method in which the number of tap is stored. I'm pretty sure TouchCount is not it... What is the operator to perform the "count and store taps"?
« Last Edit: July 05, 2012, 05:56:07 AM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3637
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: How do you store the amount of taps on screen?
« Reply #1 on: July 04, 2012, 08:38:49 AM »
Set up a Listener state on the cube with a Touch Object Event. When touched transition to a Touched state that adds one to TapNumber, checks against NumOfTaps, and either returns to Listener if less than, or to the Sphere state if equal to.

Probably easier to mockup than describe :) Let me know if you need a screenshot...

sinman

  • Playmaker Newbie
  • *
  • Posts: 14
    • View Profile
Re: How do you store the amount of taps on screen?
« Reply #2 on: July 04, 2012, 11:13:35 PM »
Hi Alex. Thanks for the reply.
"Add Int" was the key. Problem solved!