See inside and backpack the sprite. Use example: https://scratch.mit.edu/projects/770422368
It calculates mouse X and Y(pokémon reference) speed. Use this if you want but give credit. Cheers and good scratching!