Discuss Scratch

Stormfury
Scratcher
6 posts

Making your sprite go to your mouse pointer.

To make your sprite to go to your mouse pointer first get when the green flag is click then get a forever block and place it on the bottom of the when
the green flag is click block and get set y to and set x to and put it inside the forever block and get a mouse x and put it in the circle in the set x to block and get a mouse y block and put it in the circle of the set y to block and put it on the bottom of the set x to block..If you want to make it neat put a next costume block on the bottom of the set y to block.And thats it for making the sprite go to your mouse pointer See you next time!

Scratch.mit.edu/users/Stormfury/
DudmasterUltra
Scratcher
100+ posts

Making your sprite go to your mouse pointer.

Or…
when green flag clicked
forever
go to [mouse-pointer v]
end
Stormfury
Scratcher
6 posts

Making your sprite go to your mouse pointer.

Or you can do this……
when green flag clicked
forever

point towards [mouse pointer v]
move (5) steps
play sound [Ya v] until done
end
littlemoy
Scratcher
1 post

Making your sprite go to your mouse pointer.

thanks
BeeBoy10
Scratcher
48 posts

Making your sprite go to your mouse pointer.

This could be really helpful if you're making a target shooting game.
supersmashbros123
Scratcher
10 posts

Making your sprite go to your mouse pointer.

tanks
miniman57
Scratcher
1 post

Making your sprite go to your mouse pointer.

for some reason the sprite doesn't go on to the mouse. instead it's a bit off if anyone knows how to fix it that'd be great
bubble103
Scratcher
500+ posts

Making your sprite go to your mouse pointer.

miniman57 wrote:

for some reason the sprite doesn't go on to the mouse. instead it's a bit off if anyone knows how to fix it that'd be great
Maybe the costume isn't in the centre of the canvas. That could be causing the problem.
invisibowl
Scratcher
23 posts

Making your sprite go to your mouse pointer.

DudmasterUltra wrote:

Or…
when green flag clicked
forever
go to [mouse-pointer v]
end

Stormfury wrote:

Or you can do this……
when green flag clicked
forever

point towards [mouse pointer v]
move (5) steps
play sound [Ya v] until done
end

or this

object: INVERSE_CURSOR
when I receive [green flag clicked v]
broadcast [start v]
forever

set x to ((mouse x) * (-1))
set y to ((mouse y) * (-1))
end

when I receive [green flag clicked v]
forever

set [-x v] to [x position]
set [-y v] to [y position]
end

object: CURSOR
when I receive [start v]
broadcast [started v]

when I receive [started v]
forever

set x to ((-x) * (-1))
set y to ((-y) * (-1))
end

object: SPRITE
when green flag clicked
broadcast [green flag clicked v]

when I receive [green flag clicked v]
broadcast [message received v]

when I receive [message received v]
forever

point towards [CURSOR v]
turn ccw (360) degrees
move (5) steps
end
liam48D
Scratcher
1000+ posts

Making your sprite go to your mouse pointer.

Here's a completely wasteful-of-space way:

when GF clicked
forever
point towards [mouse-pointer v]
move (distance to [mouse-pointer v]) steps
jwoo121
Scratcher
11 posts

Making your sprite go to your mouse pointer.

When I do that it does follow exactly were its meant to be
Weirdo_Games
Scratcher
5 posts

Making your sprite go to your mouse pointer.

HardClaw57
Scratcher
500+ posts

Making your sprite go to your mouse pointer.

Why are you all overcomplicating?
when green flag clicked
forever

go to front
go to [mouse pointer v]
end
Fire_Legend
New Scratcher
3 posts

Making your sprite go to your mouse pointer.

Mouse Pointer is actually where the mouse points, the sprite goes. It's a leash for the sprite.
DrKat123
Scratcher
1000+ posts

Making your sprite go to your mouse pointer.

Fire_Legend wrote:

Mouse Pointer is actually where the mouse points, the sprite goes. It's a leash for the sprite.
Please don't necrobump an old topic. Remember to check the dates of the post before posting
lulupy7
Scratcher
13 posts

Making your sprite go to your mouse pointer.

liam48D wrote:

Here's a completely wasteful-of-space way:

when GF clicked
forever
point towards [mouse-pointer v]
move (distance to [mouse-pointer v]) steps

do you have a script that can make a sprite glide to the place where the mouse clicked so i can let go and the sprite will still glide to where i clicked
plzzzzzzzzzzzz help meeeeeee

Last edited by lulupy7 (Jan. 1, 2016 17:41:45)

deck26
Scratcher
1000+ posts

Making your sprite go to your mouse pointer.

lulupy7 wrote:

liam48D wrote:

Here's a completely wasteful-of-space way:

when GF clicked
forever
point towards [mouse-pointer v]
move (distance to [mouse-pointer v]) steps

do you have a script that can make a sprite glide to the place where the mouse clicked so i can let go and the sprite will still glide to where i clicked
plzzzzzzzzzzzz help meeeeeee
glide () secs to x: (mouse x) y: (mouse y)
Christians_Games
Scratcher
10 posts

Making your sprite go to your mouse pointer.

lulupy7 wrote:

liam48D wrote:

Here's a completely wasteful-of-space way:

when GF clicked
forever
point towards [mouse-pointer v]
move (distance to [mouse-pointer v]) steps

do you have a script that can make a sprite glide to the place where the mouse clicked so i can let go and the sprite will still glide to where i clicked
plzzzzzzzzzzzz help meeeeeee


when green flag clicked
forever

if <mouse down?> then
glide (1) secs to x: (mouse x) y: (mouse y)

end

end


Or…

when green flag clicked
forever

if <mouse down?> then
go to x: (mouse x) y: (mouse y)

end

end

Last edited by Christians_Games (Jan. 1, 2016 19:58:07)

Invisible_Factory
Scratcher
500+ posts

Making your sprite go to your mouse pointer.

when green flag clicked
forever

go to [mouse-pointer v]
end

Last edited by Invisible_Factory (Jan. 1, 2016 20:56:20)

Panda_Jas04
Scratcher
3 posts

Making your sprite go to your mouse pointer.

How about when we want to make a sprite appear where I clicked?

Powered by DjangoBB