This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-07-17 11:03:17

Kajunkat
Scratcher
Registered: 2012-06-30
Posts: 37

How Do I Make Something follow my cursor?

I want to make a brush follow your cursor. How can I do this?

Offline

 

#2 2012-07-17 11:09:43

maxdoss
Scratcher
Registered: 2010-07-27
Posts: 1000+

Re: How Do I Make Something follow my cursor?

when gf clicked
forever
point towards [mouse-pointer]
move (how many you need) steps
Hope that helps!

Last edited by maxdoss (2012-07-17 11:10:45)


It's my birthday. Deal with it.

Offline

 

#3 2012-07-17 11:38:06

360-International
Scratcher
Registered: 2011-07-17
Posts: 100+

Re: How Do I Make Something follow my cursor?

forever
go to x: ([x position v] of [mouse-pointer v]) y: ([y position v] of [mouse-pointer v])


https://lh4.googleusercontent.com/Oib6kyze-OrCFIRlqL6HYnWuHBQp1GfFoh5CkBlZGe3_9WCk-_DDwgfFrnD_mxJ_x2b18hMUyV2KVtIDiLdebyWaQQ6fbpKpZs-8auVep1zoSgOv-iA

Offline

 

#4 2012-07-17 11:39:52

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: How Do I Make Something follow my cursor?

360-International wrote:

forever
go to x: (mouse x) y: (mouse y)


http://i47.tinypic.com/2iaa73k.png

Offline

 

#5 2012-07-17 11:47:13

360-International
Scratcher
Registered: 2011-07-17
Posts: 100+

Re: How Do I Make Something follow my cursor?

berberberber wrote:

360-International wrote:

forever
go to x: (mouse x) y: (mouse y)

hmm

*feels stupid* I knew that...


https://lh4.googleusercontent.com/Oib6kyze-OrCFIRlqL6HYnWuHBQp1GfFoh5CkBlZGe3_9WCk-_DDwgfFrnD_mxJ_x2b18hMUyV2KVtIDiLdebyWaQQ6fbpKpZs-8auVep1zoSgOv-iA

Offline

 

#6 2012-07-17 11:57:26

thebriculator
Scratcher
Registered: 2011-07-11
Posts: 500+

Re: How Do I Make Something follow my cursor?

uhhh, guys?

forever
go to [mouse pointer v]
end

Last edited by thebriculator (2012-07-17 11:57:55)


.     http://tiny.cc/2cwgpw    http://tiny.cc/viwgpw    http://tiny.cc/iwwgpw

Offline

 

#7 2012-07-17 11:58:28

360-International
Scratcher
Registered: 2011-07-17
Posts: 100+

Re: How Do I Make Something follow my cursor?

thebriculator wrote:

uhhh, guys?

forever
go to [mouse pointer v]
end

neutral

Meep.

Last edited by 360-International (2012-07-17 11:58:40)


https://lh4.googleusercontent.com/Oib6kyze-OrCFIRlqL6HYnWuHBQp1GfFoh5CkBlZGe3_9WCk-_DDwgfFrnD_mxJ_x2b18hMUyV2KVtIDiLdebyWaQQ6fbpKpZs-8auVep1zoSgOv-iA

Offline

 

#8 2012-07-17 12:15:23

Kajunkat
Scratcher
Registered: 2012-06-30
Posts: 37

Re: How Do I Make Something follow my cursor?

Thanks!

Offline

 

#9 2012-07-17 20:37:01

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: How Do I Make Something follow my cursor?

Or, if you want smoother movement:

when gf clicked
forever
point towards [mouse pointer v]
move ((distance to [mouse pointer v]) / (15)) steps
end
You can replace 15 with any number you like.  The bigger the number, the slower it moves.

Last edited by amcerbu (2012-07-17 20:39:04)

Offline

 

Board footer