need some help with my doubletap event

Get help using Construct 2

Post » Thu Mar 13, 2014 3:15 pm

Hello,

I cant figure out whats wrong with my double tap event... :(
Image
Arrow points to problematic statement.

capx is here:
https://dl.dropboxusercontent.com/u/169 ... /test.capx

Tap or click on left or right side of screen shud create timer and shud increase sidescroll value but my formulation is not working... :(
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Thu Mar 13, 2014 3:24 pm

I think the issue is on "add" 0.5 to DoubleTouchTime. You have to set it. Because On any touch is like every tick i think. It will add it maaany times if you touch.

Do you have to create the timer on tap? What if you already had one and just use the set timer event on tap?
B
10
S
2
Posts: 135
Reputation: 1,090

Post » Thu Mar 13, 2014 3:29 pm

Nah, thats not it...
Currently, Timer dont even get created at all untill i comment out statement i pointed out:
Timer: X Is on Layer 0

:(
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Thu Mar 13, 2014 3:49 pm

You are destroying the Timer you have at the layout on layout start.
So what happens is, when you click, there's no object Timer at all.
When you check if it is NOT on layer 0 it isn't because it doesn't exist.
When you check if it IS on layer 0 , well, it isn't either, there is no timer.
In programming that would be similar to getting a null reference error, you are trying to get something that doesn't exist.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Thu Mar 13, 2014 3:57 pm

huh.. thats not it ... :(

please try capx
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Thu Mar 13, 2014 4:07 pm

I did, and this is what happens
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Thu Mar 13, 2014 4:12 pm

can you please post me the corrected capx?
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Thu Mar 13, 2014 4:14 pm

Try explaining what exactly you are trying to do, I might be able to help
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Thu Mar 13, 2014 4:25 pm

well basicly i want to extend sidescroll value from 220 to 280 for as long as theres "timer" on screen
that "timer" is used as quick double tap controller
If he exist than doubletaping (rapid taping) is active and if not exist then its back to regular tap.

meanwhile iw find out that local variable is not working and i changed it to global.
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Thu Mar 13, 2014 4:26 pm

Just create the timer on start of the layout.

Then use "set timer" and "on timer", instead of "if destroyed".
B
10
S
2
Posts: 135
Reputation: 1,090

Next

Return to How do I....?

Who is online

Users browsing this forum: MathNook and 35 guests