How do I Follow Sprite Position using Mouse

Get help using Construct 2

Post » Sun Apr 03, 2016 6:25 am

i want to make my Sprite to use the "faceUp" animation when the mouse is above the Sprite
and same goes for up , down etc
100% shrekt
B
16
S
6
G
1
Posts: 24
Reputation: 1,711

Post » Sun Apr 03, 2016 7:44 am

If I'm understanding you correctly, a sprite is "looking" at the mouse position? You could do something like, if mouse.y is less than sprite.y: set face up, if mouse.y is greater than sprite.y :set facedown.
B
60
S
36
G
23
Posts: 342
Reputation: 17,159

Post » Sun Apr 03, 2016 5:31 pm

An event with two conditions for each position:
This one would be up:
compare values: mouse.y < sprite.y-(sprite.height/2)*
is between range: sprite.x-(sprite.Width/2)*<mouse.x<sprite.x+(sprite.Width/2)*

and set the animation

*(this depends of the point of reference of the sprite, i'm supposing it's the center

For the rest of positions, you just have to make variations on that
B
7
S
2
G
1
Posts: 17
Reputation: 534

Post » Mon Apr 04, 2016 3:35 am

Thanks Everyone
100% shrekt
B
16
S
6
G
1
Posts: 24
Reputation: 1,711


Return to How do I....?

Who is online

Users browsing this forum: ultrafop and 12 guests