How to long press using Touch?

Get help using Construct 2

Post » Fri Aug 02, 2013 2:47 pm

Hi guys!I am trying to develop a Tower defense game for touch devices.
uhmm..

How to long press like 5 seconds using Touch?
example i want to long press touch the tower in 5 seconds after that it will destroy... help :(
Thanks! :)
B
9
S
2
Posts: 82
Reputation: 914

Post » Fri Aug 02, 2013 3:53 pm

rexrainbows timer function could be used.


Rex's timer function
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Fri Aug 02, 2013 6:49 pm

If you don't want to use third party plugins you can

global variable touchLength
Conditions: Is In Touch; Action: add dt to touchLength

Conditions: [Invert] Is In Touch; Action: set touchLength to 0

Something like that?
B
51
S
13
G
8
Posts: 194
Reputation: 7,311

Post » Fri Aug 02, 2013 7:45 pm

Make a new variable (global or instance)

On touch tower          - set the var to 0
Is touching tower     - add dt to var
var = 5               - destroy towerKFC2013-08-02 19:47:21
B
33
S
12
G
7
Posts: 227
Reputation: 7,582

Post » Sat Aug 03, 2013 9:30 am

Thanks!
Yeah Something like that!But,What is the dt thingy?
Do you have some sample for that?


B
9
S
2
Posts: 82
Reputation: 914

Post » Sat Aug 03, 2013 11:13 am

B
33
S
12
G
7
Posts: 227
Reputation: 7,582

Post » Sat Aug 03, 2013 4:59 pm

Thanks Guys!But...

I have a little problem.
I don't really understand the timer plugins of rexrainbow...

problem is...
When I release the touch it will count 5 seconds then it will destroy tower.

The thing that I want to happen is
when I long press touched the tower it will count 5 seconds after that it will destroy or upgrading the tower...

HELP...



B
9
S
2
Posts: 82
Reputation: 914


Return to How do I....?

Who is online

Users browsing this forum: RobertMKD and 7 guests