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.
Develop games in your browser. Powerful, performant & highly capable.
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.
Thanks a lot Chrisinfinger !