How do I simulate ELSE on clicked object?

Get help using Construct 2

Post » Thu Feb 16, 2017 9:45 pm

Hello,

I have one big sprite as a background and several small sprites on top of background.

I want to know if I clicked small sprite (add score) or clicked anywhere else (decrease score). Currently when I click on small sprite then I get add score and decrease score together because both sprites are under mouse cursor.

Something like:
IF small sprite is clicked:
add score
ELSE if big sprite is clicked:
...i want to go there...
ENDIF

Any ideas?
B
5
Posts: 8
Reputation: 241

Post » Thu Feb 16, 2017 10:28 pm

Root event ___On click (< the trigger, triggers cant stand an else, so now a sub event)
________Sub event___Cursor is over object (small one)
________________________Action for the little one
________Else
________Cursor is over object (big one)
________________________Action for the big one
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Feb 17, 2017 2:18 am

@rotacak

99Instances2Go suggestion should work fine, another way would be to add a second condition to the big sprite click that says "mouse not over small spite"

so:
IF small sprite is clicked: add score

IF big sprite is clicked AND mouse not over small sprite: decrease score


(You do a "not over" condition by adding another condition that says Mouse Over object, and then right-click that and invert it)
B
95
S
33
G
20
Posts: 438
Reputation: 17,640

Post » Fri Feb 17, 2017 9:01 pm

Thank you, it works :)
B
5
Posts: 8
Reputation: 241


Return to How do I....?

Who is online

Users browsing this forum: Nicolas951, Shenkai the ssj, Yahoo [Bot] and 22 guests