How do I make a character mirror based on mouse location

Get help using Construct 2

Post » Sat Feb 06, 2016 10:53 pm

Hi, I am making a character, using a mouse. I want him to get set mirrored, based on where the mouse is. I tried using angle, but that rotates him entirely, and I just want him to go mirrored then unmirrored.

Help would be greatly appreciated, thanks
B
5
Posts: 2
Reputation: 231

Post » Sat Feb 06, 2016 11:18 pm

I'm going to assume you want the sprite mirrored if the mouse is to the left of it, and not mirrored if to the right of it. In that case, You just do
Code: Select all
Mouse.X > Sprite.X
-> Sprite set Not Mirrored
Else
-> Sprite set Mirrored
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Post » Sat Feb 06, 2016 11:19 pm

Assuming you're making a platformer or a side scroller game, just compare character's x coordinate with the x coordinate of the mouse. If your character is facing right by default, then if the x of the mouse is less than character's x you mirror the character and if it isn't less then stop mirroring
Banned User
B
6
S
3
Posts: 105
Reputation: 1,170


Return to How do I....?

Who is online

Users browsing this forum: Christmas, Hassan Hackmi, minigame and 6 guests