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
25
S
13
G
19
Posts: 56
Reputation: 11,741

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
42
S
13
G
2
Posts: 329
Reputation: 4,085


Post » Sat Oct 07, 2017 2:27 am

Just use gestures instead of basic touch events.
Image
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
71
Posts: 1,063
Reputation: 38,689

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
25
S
13
G
19
Posts: 56
Reputation: 11,741

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.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
71
Posts: 1,063
Reputation: 38,689

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
25
S
13
G
19
Posts: 56
Reputation: 11,741

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..
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
71
Posts: 1,063
Reputation: 38,689



Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests