Double tap and tap events on the sprite

Discussion and feedback on Construct 2

Post » Tue Feb 14, 2017 12:24 pm

gameglaux wrote:
lamar wrote:If it always runs it is because he is not using the trigger variable properly.

If he wants to post an image of his events or a CAPX I will gladly look at why his tap event is always running.


Unless ive not had enough coffee this morning, it doesnt matter. If you put a tap and a double tap trigger on an object, the tap will always run.


You are absolutely right :) I've verified it in visual studio - the same situation, "double tap" is always ignored if "tap" is also presented.

I see now, this is phisically is not possible to have the both events. The "wait" action in "tap" in order to distinguish "just tap" from "double tap" will make user crazy (me too, by the way :)
B
9
S
2
Posts: 34
Reputation: 603

Post » Tue Feb 14, 2017 12:37 pm

Well there is the capx showing it done:

https://www.dropbox.com/s/5l65bwdugjuby27/Tap%20Example.capx?dl=0

There are the events:

Image

Works like a charm guys!

I'd say you need more coffee.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Tue Feb 14, 2017 12:55 pm

lamar wrote:No and there is my events using the same sprite with tap and double tap. It sets the variable to 1 on tap and 0 on double tap.


Setting the variable is an action, not an event. The tap event runs every touch on that object. Double tap or single tap.
Image
B
30
S
9
G
3
Posts: 171
Reputation: 3,329

Post » Tue Feb 14, 2017 12:56 pm

Sorry for trowing something in your coffee.

When pause = off ... A double tap will switch it on .. then off (after a short time).
Clearly showing that the 'on tap' runs its actions, even when double tapped.

The easy solution is in my example.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Feb 14, 2017 1:07 pm

gameglaux wrote:
lamar wrote:No and there is my events using the same sprite with tap and double tap. It sets the variable to 1 on tap and 0 on double tap.


Setting the variable is an action, not an event. The tap event runs every touch on that object. Double tap or single tap.



That is why you use the variable to trigger the event!
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Tue Feb 14, 2017 1:08 pm

99Instances2Go wrote:Sorry for trowing something in your coffee.

When pause = off ... A double tap will switch it on .. then off (after a short time).
Clearly showing that the 'on tap' runs its actions, even when double tapped.

The easy solution is in my example.


Yes, you can perform a check so the logic doesnt trigger... but the event still does. Thats all im saying and I think thats where the OP is going wrong :)
Image
B
30
S
9
G
3
Posts: 171
Reputation: 3,329

Post » Tue Feb 14, 2017 1:11 pm

99Instances2Go wrote:Sorry for trowing something in your coffee.

When pause = off ... A double tap will switch it on .. then off (after a short time).
Clearly showing that the 'on tap' runs its actions, even when double tapped.

The easy solution is in my example.


WHY would you need to use double tap on the same object if double tap event is already running?

If you need that use single tap and just toggle the variable.

Tap and double tap are separate actions and used properly on the same sprite work as they are supposed to.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Tue Feb 14, 2017 1:15 pm

Dear lamar, you made the perfect capx to clearly show the opposite. So allow me to rest your case.

Want a fresh coffee to make up ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Feb 14, 2017 1:19 pm

lamar wrote:
gameglaux wrote:
lamar wrote:Tap and double tap can be used on the same sprite.



Image

Use tap or double tap to set a trigger using a global variable.



The OP is already using this. The problem is the tap gesture always runs :)


If it always runs it is because he is not using the trigger variable properly.

If he wants to post an image of his events or a CAPX I will gladly look at why his tap event is always running.


Lamar, her is screen shot (from my google drive, for I don't know how to directly insert image in this forum)
https://drive.google.com/file/d/0B6ZvCe ... FwbTA/view
B
9
S
2
Posts: 34
Reputation: 603

Post » Tue Feb 14, 2017 1:21 pm

99Instances2Go wrote:Dear lamar, you made the perfect capx to clearly show the opposite. So allow me to rest your case.

Want a fresh coffee to make up ?


I would say you simply don't understand the function of double tap and tap to set a variable trigger but maybe can't admit it?

If you have already set a variable with double tap why would you double tap again.

If you need to toggle between event actions use single tap and just toggle the variable.

It is that simple!
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: tarek2 and 5 guests