How do I make a touch hold?

Get help using Construct 2

Post » Fri Oct 06, 2017 7:39 pm

So my game has a touch to jump, which works fine. My character always moves forward btw.
But I'm trying to add a 'touch hold to stop moving' but can't get it to work, as soon as I click to hold he jumps.
I tried making him jump of touch release but that felt laggy. Is there around this?

The game is here if you want to a better idea of how it currently works.

Thanks in advance!
B
19
S
11
G
19
Posts: 54
Reputation: 11,350

Post » Fri Oct 06, 2017 9:19 pm

just check if player on the ground with a variable and
a next variable stop or go

make A example and i edit it for you easy

***Construct 2 FILE ONLY***
Image
B
38
S
11
G
2
Posts: 315
Reputation: 3,797


Post » Sat Oct 07, 2017 2:27 am

Just use gestures instead of basic touch events.
Image
Check out my awesome game Doptrix
B
17
S
9
G
29
Posts: 517
Reputation: 16,833

Post » Sat Oct 07, 2017 2:35 am

I'll try that.
I tried using 'tap' but I get a slight lag, don't you? I need my jumps to be precise, I can't have any wait times.


*edit: Yeah, there's a slight lag time when using 'tap'.
B
19
S
11
G
19
Posts: 54
Reputation: 11,350

Post » Sat Oct 07, 2017 2:43 am

Yes, there is a slight lag with tap, because this event triggers after the finger was lifted off the screen.
But this is the only way to do what you want.
You can't jump at Touch Start event because you can't predict if player will be doing a short touch or a long hold.
Check out my awesome game Doptrix
B
17
S
9
G
29
Posts: 517
Reputation: 16,833

Post » Sat Oct 07, 2017 2:52 am

dop2000 wrote:Yes, there is a slight lag with tap, because this event triggers after the finger was lifted off the screen.
But this is the only way to do what you want.
You can't jump at Touch Start event because you can't predict if player will be doing a short touch or a long hold.


Yeah, kind of figured... I was hoping there was a way to make the lag smaller. I wonder if swipe vs tap would be better somehow? Or perhaps a double finger tap? :)
B
19
S
11
G
19
Posts: 54
Reputation: 11,350

Post » Sat Oct 07, 2017 3:03 am

Swipe and double finger tap are both gestures, which means there also will be lags if you use them..
Check out my awesome game Doptrix
B
17
S
9
G
29
Posts: 517
Reputation: 16,833



Return to How do I....?

Who is online

Users browsing this forum: jbr190 and 34 guests