Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » A pulling question!
- cubby208
-
99 posts
A pulling question!
I have a game and I want every object to go twords the mouse. The important thing is that the farther it is the slower and the closer it is the faster. This pull will only happn when the mouse is down. Any ideas on how I can get this to happen? Scratchblocks much appreciated!
- Glboom
-
4 posts
A pulling question!
You could broadcast it:
And in the object that you want to look at the mouse and move:
the less 100 steps gets divided, meaning faster movement.
This code makes the object move slower the closer it is:
And in the object that you want to look at the mouse and move:
So what happens is the closer you are to the mouse pointer,
the less 100 steps gets divided, meaning faster movement.
This code makes the object move slower the closer it is:
- cubby208
-
99 posts
A pulling question!
Wow your a miracle worker! You allways aw set my questions your a great community member! How about this?
http://scratch.mit.edu/projects/12389162/
- HeroBrineNZK
-
82 posts
A pulling question!
Sometimes this works
because the further the mouse is, it takes longer for the computer to get a sprite to go to the pointer
- jasonsrvca
-
1 post
A pulling question!
You could broadcast it:
And in the object that you want to look at the mouse and move:So what happens is the closer you are to the mouse pointer,
the less 100 steps gets divided, meaning faster movement.
This code makes the object move slower the closer it is:
Thank you, this helped so much!
Last edited by jasonsrvca (March 27, 2014 02:14:55)
- Discussion Forums
- » Help with Scripts
-
» A pulling question!