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

#1 2009-05-02 10:23:00

billzter
Scratcher
Registered: 2009-04-21
Posts: 3

Getting towards the mouse.

Hey, I'm making a kind of RPG game. I want it so when I click, the sprite goes to the place where the mouse clicked. Any help will be greatly appreciated.

I got this so far:
<when green flag clicked>
<if>(mouse down)
<point towards( mouse pointer)
<forever>
<move(1)steps>


http://i433.photobucket.com/albums/qq53/billzter/WOA-1.jpg World of adventure- Play today!

Offline

 

#2 2009-05-02 10:32:35

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Getting towards the mouse.

You can try this:
when green flag clicked
      if <mouse down>
           go to [mouse-pointer]
      wait until <not <mouse down> >

Offline

 

#3 2009-05-02 10:39:03

DawnLight
Scratcher
Registered: 2009-04-25
Posts: 500+

Re: Getting towards the mouse.

billzter wrote:

Hey, I'm making a kind of RPG game. I want it so when I click, the sprite goes to the place where the mouse clicked. Any help will be greatly appreciated.

I got this so far:
<when green flag clicked>
<if>(mouse down)
<point towards( mouse pointer)
<forever>
<move(1)steps>

Maybe you should look at the code of DSdude10's Club penguin project to help?
Hope that Helps!

Offline

 

#4 2009-05-02 10:48:32

billzter
Scratcher
Registered: 2009-04-21
Posts: 3

Re: Getting towards the mouse.

Ok, I figured it out. I used wait until. Thanks!


http://i433.photobucket.com/albums/qq53/billzter/WOA-1.jpg World of adventure- Play today!

Offline

 

#5 2009-05-02 14:00:07

iab97
Scratcher
Registered: 2009-04-04
Posts: 100+

Re: Getting towards the mouse.

I actually didn't know how to do that!
In fact, that could REALLY help me!

Thanks guys!


-iab97 One of my favorite quotes: "You can't direct the wind, but can adjust your sails." -Unknown

Offline

 

#6 2009-05-04 05:30:29

billzter
Scratcher
Registered: 2009-04-21
Posts: 3

Re: Getting towards the mouse.

<when green flag clicked>
<if><mouse down?>
<glide( INSERTNUMBERHERE )secs to x sad  <mouse x> )y sad  <mouse y>


http://i433.photobucket.com/albums/qq53/billzter/WOA-1.jpg World of adventure- Play today!

Offline

 

#7 2009-05-04 06:22:49

bosox397
Scratcher
Registered: 2008-02-17
Posts: 1000+

Re: Getting towards the mouse.

YEs that works too.  smile


Dear Scratch Users,
I'm done with scratch, or at least making projects. I have made one last big game, thats both fun and teaches a lesson about water. It'd mean a lot if you gave me feedback.                              http://scratch.mit.edu/projects/bosox397/569201

Offline

 

#8 2009-05-13 22:39:48

llanier
Scratcher
Registered: 2008-12-09
Posts: 9

Re: Getting towards the mouse.

billzter wrote:

<when green flag clicked>
<if><mouse down?>
<glide( INSERTNUMBERHERE )secs to x sad  <mouse x> )y sad  <mouse y>

I'm trying to adjust mine to one similar to this.  The difference is that im getting the computer to automatically change the amount of time gliding.  this way, it will stay the same speed.

Offline

 

Board footer