Touch sometimes doesn't accept input

Discussion and feedback on Construct 2

Post » Fri Sep 26, 2014 10:05 am

I encountered strange problem while working on mobile-targeted game. Sometimes when I tap on the screen nothing happens and it should and the same thing happend even when I play it on PC. So I stripped down the problem to a simple .capx project which I upload here. It works like this that when you tap above the character it moves up and if you tap below him it moves down. Just tap couple times up and down and I'm sure that sometime character won't move... In the project I disabled Mouse input event. When you switch input to mouse (turning of Touch) nothing like this happens. Input is always accepted correctly. I don't know what's wrong and if I can fix it?
You do not have the required permissions to view the files attached to this post.
Member of PLUS(S). Check out our games at: http://pluss.newgrounds.com/
B
8
S
1
G
1
Posts: 23
Reputation: 838

Post » Sat Sep 27, 2014 8:58 am

I think you should use something other than the Tap gesture if you want to detect fast taps. Remember it has to detect double-taps as well, so if you tap fast it will detect that. It seems to work fine if the taps are slow.

See the capx. I changed it to Touch:On any touch start. I also changed a bit of your logic (structure only).
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sat Sep 27, 2014 5:23 pm

It's perfect! Thanks :) I just wonder why did you set justTapped to 0 on every tick, but probably so you just won't have to double this instruction. As I think about it, it's a nice trick to remember ;)
Member of PLUS(S). Check out our games at: http://pluss.newgrounds.com/
B
8
S
1
G
1
Posts: 23
Reputation: 838

Post » Sat Sep 27, 2014 11:00 pm

samur wrote:It's perfect! Thanks :) I just wonder why did you set justTapped to 0 on every tick, but probably so you just won't have to double this instruction. As I think about it, it's a nice trick to remember ;)


Not really a trick, just more concise logic.. Less code=easier reading/maintenance. Remember 'every tick' there is not really every tick.. Just when the conditions are true.

Oh yeah as you saw I changed it to portrait for easier testing for me.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 22 guests