how do i make the sprite follow the mouse pointer?
Offline
thank you zammer
Offline
Additionally, if you wanted to be fancy, you could do something like this (sorry, not going to make a picture of the blocks XD):
"When Green Flag clicked"
"Forever"
"Point towards mouse-pointer"
"Move 'Distance to mouse-pointer * -1' steps"
.......................................................................................................................
In doing that, it will make the sprite go to the mouse pointer at different speeds; the farther away it is, the faster it will go...
Offline
r2dav2 wrote:
Additionally, if you wanted to be fancy, you could do something like this (sorry, not going to make a picture of the blocks XD):
"When Green Flag clicked"
"Forever"
"Point towards mouse-pointer"
"Move 'Distance to mouse-pointer * -1' steps"
.......................................................................................................................
In doing that, it will make the sprite go to the mouse pointer at different speeds; the farther away it is, the faster it will go...
Wouldn't work, "distance / 20" would though
Offline
You can also do something like this, where the object will move towards the mouse more quickly when it's further away:
when gf clicked forever point towards [mouse pointer v] move ((distance to [mouse pointer v]) / (10)) steps end
Offline
If you want the sprite to follow the mouse, use this, I find 10 to be close, but still smooth. Not taking as long to get to the mouse as 20:
when gf clicked forever point towards [mouse-pointer v] move ((distance to [mouse-pointer v]) / (10)) steps endBut if you want it to follow it so closely, it's almost the mouse itself, you could just use this
when gf clicked forever go to [mouse-pointer v] end
Last edited by henley (2012-07-09 15:37:50)
Offline
henley wrote:
when gf clicked forever point towards [mouse-pointer v] move ((distance to [mouse-pointer v]) / (10)) steps end
SciTecCf wrote:
when gf clicked forever point towards [mouse-pointer v] move ((distance to [mouse-pointer v]) * (0.1)) steps end
lol
Offline
:]
Offline
WillowfurXAmberclaw wrote:
:]
Please only post things that contribute to the topic, or are helpful in some way.
Offline
Or [scratchblocks]when gf clicked
forever
if <mouse down?>
point towards [mouse-pointer v]
move (10) steps
else
point towards [mouse-pointer v]
move (5) steps
[scratchblocks]
Can someone fix this for me?
Last edited by Firedrake969 (2012-07-15 18:11:28)
Offline
Firedrake969 wrote:
Or
when gf clicked forever if <mouse down?> point towards [mouse-pointer v] move (10) steps else point towards [mouse-pointer v] move (5) stepsCan someone fix this for me?
fix<ed> scr(i)p<ts>
Offline
when green flag clicked
forever
point towards [mouse-pointer v]
if <(distance to [mouse-pointer v]) < [50]>
move (-10) steps
end
if <(distance to [mouse-pointer v]) > [70]>
move (10) steps
end
end
Offline
11g-tucker wrote:
how do i make the sprite follow the mouse pointer?
when gf clicked forever if distance to < [mouse-pointer v] > >[10]// if it is this far away... point towards [mouse-pointer v]//point towards mousepointer.. move (5) steps//at this speed, move to mousepointerOr, just do this:
when gf clicked forever show go to [mouse-pointer v] // the sprite will go to pointer without gliding
Last edited by joshuaho (2013-04-25 17:41:59)
Offline