Question regarding mouse event handling

Just started using Construct 2? Post your questions here

Post » Mon Jun 13, 2016 4:18 pm

Hi,

I have a specific question regarding handling a mouse event. The requirement is that there are 2 objects, say, A and B. At any point of time either A or B should be visible (but not both).

Now on a mouse click, the visibility of A and B should toggle i.e. if A is visible prior to the mouse click, then post the mouse click A should disappear and B should become visible. On the next mouse click A should be visible and B should disappear.

How should I go about this. I tried a number of things and went through a few tutorials and posts but couldn't find the answer. Please help.

Regards,
zanycore
B
10
S
4
Posts: 12
Reputation: 774

Post » Mon Jun 13, 2016 4:58 pm

Like this?
https://drive.google.com/open?id=0Bx-ufu2WID53UnFSUFc4MnZJWHc (use download arrow in upper right corner)

You could use an instance variable attached to one of the sprites as well, I just used global for simplicity.
Last edited by chrisinfinger on Mon Sep 05, 2016 3:50 pm, edited 1 time in total.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
68
S
17
G
8
Posts: 637
Reputation: 9,420

Post » Tue Jun 14, 2016 8:03 am

Thanks a lot Chrisinfinger !
B
10
S
4
Posts: 12
Reputation: 774


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 5 guests