How to do click on the drawn shape

131 Views Asked by At

how to click on a drawn figure so that after clicking it disappears, so far it has turned out to click on the entire playing area.

    if (FlxG.mouse.pressed) 
    {
        remove(circle); 
    }
1

There are 1 best solutions below

0
Dispensable Joe On

You're only checking if the mouse is being pressed, you should first check if the mouse is overlapping the sprite and only get the click when that's true.

An example https://gamefromscratch.com/haxeflixel-tutorial-mouse-input/