How do I Change Sprite based on Mouse Position

Just started using Construct 2? Post your questions here

Post » Sat Jun 14, 2014 5:26 pm

I have two Idle sprites, IdleR and IdleL. I want to change it to IdleL when the mous is on the left side of the player and IdleR when the mouse is on the right. How do I do that?
B
4
Posts: 10
Reputation: 220

Post » Sat Jun 14, 2014 8:25 pm

This might help. If you have 2 sprites just so 1 object can change the way it looks I recommend you use 1 sprite with 2 animations.
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 41
Reputation: 762

Post » Sat Jun 14, 2014 11:48 pm

and to save file space etc, instead of using 2 seperate idle animations, simply mirror the exiting player sprite.

so use mouse.x < player.x -> set mirrored = true
mouse.x > player.x -> set mirrored = false

this will mirror all animations, not just the one idle as well :)
B
90
S
44
G
17
Posts: 1,012
Reputation: 18,527

Post » Mon Jun 16, 2014 1:46 pm

try this simple mouse anim
You do not have the required permissions to view the files attached to this post.
B
257
S
42
G
15
Posts: 1,991
Reputation: 41,411


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest