I am having some trouble with a game I am making. I want it so the player sprite will point in the direction 90 if the mouse pointer is more on the right side of the player sprite and the player sprite will point in the direction -90 if the mouse pointer is more on the left side of the player sprite. Help please! I could not find the, direction of mouse pointer (sensing).
Offline
Well, there is no <direction of mouse pointer> block, because the cursor doesn't have a direction - it's just a point with an x and a y value.
Instead, just check if the mouse's x value is greater than or less than the sprite's value.
When green flag clicked forever if (mouse x) > (x position) point in direction (90) else point in direction (-90)
Hope that helps!
Offline
Harakou wrote:
Well, there is no <direction of mouse pointer> block, because the cursor doesn't have a direction - it's just a point with an x and a y value.
Instead, just check if the mouse's x value is greater than or less than the sprite's value.Code:
When green flag clicked forever if (mouse x) > (x position) point in direction (90) else point in direction (-90)Hope that helps!
Thanks! Now I just need to remember which project that was in... XD
Offline