Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: sinman on July 04, 2012, 03:37:45 AM

Title: [SOLVED] How do you store the amount of taps on screen?
Post by: sinman 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"?
Title: Re: How do you store the amount of taps on screen?
Post by: Alex Chouls 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...
Title: Re: How do you store the amount of taps on screen?
Post by: sinman on July 05, 2012, 02:13:35 AM
Hi Alex. Thanks for the reply.
"Add Int" was the key. Problem solved!