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

#1 2012-04-29 13:09:43

Atmospheric
New Scratcher
Registered: 2012-04-26
Posts: 100+

Beginner's Guide: How To Make A Sprite Follow Your Mouse

How To Make A Sprite Follow Your Mouse

Dear New Scratchers,
Welcome to the first issue post of the Beginner's Guide! It's been a great pleasure to type and show everyone (especially the new) handy, easy and simple tricks which are highly effective.  I remeber when I was  new to Scratch, and had no idea how to program, even the basic things. I would get confused when I clicked on the stage and realised that I had no scripts, when I thought there was just one long script. So let me guide all of you, even if you are not new, to creating simple scripts! So for the first tutorial, I am going to show you how to program a basic script, which can make a certain sprite(s), trail and follow your mouse! I hope my information will be of use to you! Let's begin. A basic, and example of this can be seen Here.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Short Script For Something To Follow Your Mouse

Ok - Let's start by showing you a script to make something follow your mouse.

when gf clicked
forever
 go to [mouse-pointer v]
As you can see, this is a very short script, which is not complex at all! But I have seen many people posting on the Help with Scripts forum who have had some trouble with working out how to make something follow your mouse.

Here is another example of a type of mouse-following.
when gf clicked
forever
go to x:<mouse y> y:<mouse x> // This is where you swap mouse values.
What Is Mouse Values?
Mouse values are when your mouse is in a position, but the sprite following your mouse, is in another position, for example in This Project. It is like being in an opposite position to your mouse.

That's All For This Week!
WEEK ONE COMPLETE! *YAY*

Offline

 

#2 2012-04-29 13:16:39

ReuleauxStudios
New Scratcher
Registered: 2012-04-29
Posts: 9

Re: Beginner's Guide: How To Make A Sprite Follow Your Mouse

Nice! Very helpful.

Offline

 

#3 2012-04-29 13:18:09

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Beginner's Guide: How To Make A Sprite Follow Your Mouse

If you want more methods, the Scratch Wiki has a nice article about it heresmile

Offline

 

#4 2012-04-29 13:26:15

Atmospheric
New Scratcher
Registered: 2012-04-26
Posts: 100+

Re: Beginner's Guide: How To Make A Sprite Follow Your Mouse

scimonster wrote:

If you want more methods, the Scratch Wiki has a nice article about it heresmile

I really should have mentioned that, shouldn't I?  I could request for it to be edited, but didn't they change the request rule or something?

Offline

 

#5 2012-05-02 12:48:09

Atmospheric
New Scratcher
Registered: 2012-04-26
Posts: 100+

Re: Beginner's Guide: How To Make A Sprite Follow Your Mouse

Any requests for scripts and methods, or forum tips are welcome. Currently looking for some  smile

Offline

 

#6 2012-05-04 23:11:47

humhumgames
Scratcher
Registered: 2012-03-26
Posts: 1000+

Re: Beginner's Guide: How To Make A Sprite Follow Your Mouse

Can you make one on scrolling? I already know how to, but I want to be able to have a game scroll like Wes64's Specrum RPG, where the whole screen scrolls, not just a box at the bottom (What I know how to do). I don't know if this is simple, but  I really need some advice and I am willing to bet that a lot of scratchers want to know how to do this.

Very nice, and I am looking forward to coming issues of  Begginer's Guide!

Offline

 

#7 2012-05-06 00:22:54

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Beginner's Guide: How To Make A Sprite Follow Your Mouse

May I make a suggestion?

when gf clicked
forever
   point towards [mouse-pointer]
   move (5) steps
   wait (0.01) secs
end

Last edited by Firedrake969 (2012-05-06 00:23:06)


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

Board footer