Page 1 of 1

Magnet-like repel

Posted: Wed Nov 20, 2013 4:39 pm
by calmrr3
Hello,

Is it possible to create something like this: http://www.absorblearning.com/media/att ... 4y&att=348
whereby the cursor is the main magnet and any graphics on the card animate as though they are being repelled when the cursor goes near to them.

Thanks!

Re: Magnet-like repel

Posted: Wed Nov 20, 2013 4:46 pm
by FourthWorld
Yep - to get started, see the mouseMove message and the rectangle and location properties in the Dictionary.

Re: Magnet-like repel

Posted: Thu Nov 21, 2013 3:07 am
by Simon
Hi Callum,
I know who I'm going to get to make my next video, saw yours (from another post) and they are great! :D

Ok so I've just built a demo of that magnet thing and here is my take:

Code: Select all

      put the right of btn 1 into tRight
      put the left of btn 2 into tLeft
      if tRight + 20 >= tLeft then --there is the key
            set the left of btn 2 to tRight + 20 --thats the answer
      end if
Well there is a start.
I'd be happy to help you with the rest of the mouseMove if you'd like.

Simon

Re: Magnet-like repel

Posted: Thu Nov 21, 2013 11:04 pm
by calmrr3
Hi, Thanks! much appreciated.

I'll start experimenting and see how I get on :)