touch controls

Get help using Construct 2

Post » Thu Aug 04, 2016 4:23 pm

How do I do this ?

hold tap on WalkButtonObject
-> player walks continuously until I release the hold on WalkButtonObject

Double tap (but second tap is hold) on WalkButtonObject
-> player runs continously until I release the hold on WalkButtonObject

I'm kind of new to using touch but I have spent the last 2 days trying all the Touch conditions and still can't get it to work. Sorry I had to ask now, getting desperate already
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Thu Aug 04, 2016 6:04 pm

Here is a simple one to start out on:

https://www.scirra.com/tutorials/202/touch-controls-and-a-trick-to-detect-input-method

You might eventually need to learn to track touchID and use 'is in touch' but sounds like you are needing the basics first.
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Thu Aug 04, 2016 6:22 pm

@badmoodtaylor
That tutorial is just basic, I already know that. Can you help me? I'm trying to use a timer (or I think I need to use a timer) but I can't quite get the gist of the logic/flow of the algorithm I need for this situation.

Do I need a timer to calculate a double tap (and not use the built-in double tap condition)?
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Thu Aug 04, 2016 7:13 pm

I would use the built in double tap condition unless you absolutely require special customization.
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Thu Aug 04, 2016 7:18 pm

I reread your first post and understand better.

I would make an instance variable on the player called "sprint"

On Double tap set sprint to true
On any touch release set sprint to false

If sprint is true set run speed to X
If sprint is false set run speed to Y
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests