On mouse click, 3 times?

Discussion and feedback on Construct 2

Post » Wed Dec 11, 2013 7:29 pm

I am trying to make a game that compares if the player are doing what the player suppose to do, by doing that, when ever the player click or touch or press key, it'll increment a variable to 1, then I compare this variable to another as a correct variable number.

eg.
by click on "something" var player = player + 1.
set "answer" var answer = int(andom(3)) // let say the answer is equal to 1.

for every 1 second check
if player == answer
   score = score + 10

   else
       game over


what happen is if I press the right key, it'll increment 1, but if I click on the button I have made on screen, it will increment by 3, I don't have a touch screen so I cannot test that. ( click on object "img")

How do I stop it doing that, it has been a big bug for me.
the image button I've made has a on state(animation with 1 extra frame). I did try to turn if off, nothing changes

B
3
Posts: 11
Reputation: 197

Post » Thu Dec 12, 2013 3:18 pm

If you provide your .capx then I could try to help you!
B
231
S
6
G
9
Posts: 89
Reputation: 12,903

Post » Thu Dec 12, 2013 6:14 pm

Did you use the "click" action? How about detecting using on "key up" instead?

Sounds like Construct2's click implementation detects both key down + key up, and hence the reason for the multiple clicks. Is that true @Ashley? I've never ran into this problem, but I think using on key up will solve the problem.
B
10
S
3
G
1
Posts: 11
Reputation: 1,554

Post » Thu Dec 12, 2013 6:33 pm

@vervo

Did you use the "on touched object" event or the "is touching object" event? There's a large difference between the two.
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Tue Dec 17, 2013 4:21 am


[QUOTE=syncdot] Did you use the "click" action? How about detecting using on "key up" instead?

Sounds like Construct2's click implementation detects both key down + key up, and hence the reason for the multiple clicks. Is that true @Ashley? I've never ran into this problem, but I think using on key up will solve the problem.[/QUOTE]

Im using "key is pressed"

[QUOTE=retrodude] @vervo

Did you use the "on touched object" event or the "is touching object" event? There's a large difference between the two.[/QUOTE]

Thanks, I realised I set it as "is touching object, now change to on touched object"

now it increment twice than 3 times.
vervo2013-12-17 04:35:22
B
3
Posts: 11
Reputation: 197


Return to Construct 2 General

Who is online

Users browsing this forum: Artpunk and 2 guests