A Question for the Mouse drag and click

Is there a way to make it so that when you click and drag, you can affect multiple sprites or no. I am making a sandbox game and would like to know if I could do that.

I’m definitely a flowlab rookie - but if it helps I might try this:

On mouse down, read X and y. On mouse up, read X and y.

Take these X and y’s and divide them, to find the centre of the region you selected.

Spawn an invisible ‘selector’ sprite at those coordinates.

All other normal sprites react to proximity of the selector, and toggle the “I am selected” logic chain, doing whatever you want them to do when selected.

On mouse click down, read X and y,. On mouse click up read X and y. If the two readings are within 10 units of each other, rather than spawning a selector, instead send a message to all selector’s telling them to destroy themselves.

All your other sprites would have a timer triggered by the “I am selected” chain which checks every 10/s if they are STILL in proximity to a selector. If they are no longer, turn off the “I am selected” logic chain.

I’ll play around with an example later today.

-Kollama

Thank you.

if ur still wondering how to do this, heres a game thatll help:
Unfortunatley, if its affected by gravity its a bit glitchy tho.

2 Likes