How do I can visible and invisible an sprit with mouse left click on another sprit?
Develop games in your browser. Powerful, performant & highly capable.
add a global variable called "visible" and set its value to 0
Mouse -> on object clicked -> anothersprite
System -> compare variable -> visible =0
yoursprite -> set visible -> invisible
system -> set value -> visible=1
System -> compare variable -> visible =1
yoursprite -> set visible -> visible
system -> set value -> visible=0
Why make a global variable when you already have a condition that checks for visibility , I like to keep things clean and simple . Try this out for size :
Mouse->on object clicked -> othersprite
subevent ->yoursprite ->is visible .......action->yoursprite->make invisible
->yoursprite->(inverted)is visible........action->yoursprite ->make visible
Not sure if it's best practice, but I did it this way.