I have a sprite and I need it to move to the mouse whenever the mouse is clicked. I know I have to use glide, but how do I get a constant speed. (Setting the seconds makes it zippity fast on long distances and sluggishly slow on short ones)
I have a variable named speed placed in the glide block where the (seconds) is, so what equation do I need to use to set, "speed"?
Offline
Just change the amount of seconds in the glide block. The higher the number, the slower it goes.
Offline
militarydudes wrote:
The higher the number, the slower it goes.
I know, but that makes it seem super fast on long distances and super slow on short ones. I want a constant speed so that nothing feels strange.
If it took me 5 seconds to go a mile in a car, it would be speeding, if it took me five seconds to go a foot, it would be pulled over for going two slow. That's sort of like what would happen to my sprite.
I swear I explained this in the topic post, but I explained more clear in case you needed it.
Offline
Ok, I think I understand what you mean, in the sprite that you want to move towards your mouse add [blocks]<when green flag clicked>[/blocks][blocks]<forever>[/blocks][blocks]<point towards( mouse-pointer[/blocks]
And then add [blocks]<when green flag clicked>[/blocks][blocks]<forever>[/blocks][blocks]<wait until>[/blocks][blocks]<mouse down?>[/blocks][blocks]<repeat until>[/blocks][blocks]<touching[ mouse-pointer[/blocks][blocks]<move( how fast you want it to go )steps>[/blocks]
Offline
AtomicBawm3 wrote:
Use the distance to mousepointer and divide by 100
That's awesome! It works
Offline