playMaker

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

sinman

  • Playmaker Newbie
  • *
  • Posts: 14
[SOLVED] How do you store the amount of taps on screen?
« on: July 04, 2012, 03: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, 08:56:07 AM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: How do you store the amount of taps on screen?
« Reply #1 on: July 04, 2012, 11: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
Re: How do you store the amount of taps on screen?
« Reply #2 on: July 05, 2012, 02:13:35 AM »
Hi Alex. Thanks for the reply.
"Add Int" was the key. Problem solved!