Above is the link of my code in p5.js editor.
As you can see in the code that the player which is in blue colour on the preview screen, moves on mouseX and mouseY.
I just need that player to move on dragging, it shouldn’t respond if I click over an empty region.
Can someone please help me…
Please…Please…Please…
If you implement what I’ve said before, if you drag your mouse on your player then you are going to move it. Otherwise, if it’s anywhere on the screen you do nothing.