Mirroring sprite angle issue

Get help using Construct 2

Post » Fri Jul 21, 2017 2:47 am

When a sprite becomes mirrored (using the mirror event) The angle of the sprite does not become mirrored.

I'm having this sprite setting it's angle towards the mouse cursor (set position X to Mouse.X & position Y to Mouse.Y)

so basically the characters arm(holding a gun) points towards the mouse, but when I mirror the character and his arm (in order to simulate the player turning to his left after facing right) the arm sprite flips but the angle doesn't. Making it so that when the player is facing left, the players gun points towards the opposite angle of where the mouse is.

I don't know the math to "reverse" the angle so that it the gun can point towards the mouse even when a sprite is flipped.

Can anyone help me?

Thank you!
B
15
S
7
G
2
Posts: 5
Reputation: 2,187

Post » Fri Jul 21, 2017 3:20 am

@dingalingboy

A simple capx showing the problem will be more helpful
B
38
S
22
G
51
Posts: 211
Reputation: 29,505

Post » Fri Jul 21, 2017 4:12 am

B
15
S
7
G
2
Posts: 5
Reputation: 2,187

Post » Fri Jul 21, 2017 8:29 am

@dingalingboy


This the only way I could think of today it was quite challenging, I'm sure some one else could it better, you have to set ups to try, the "BODDY GUN" is the one you asked for and the "GUN ARM" this is just with the arm moving to give you some ideas, I hope it helps.

capx: https://www.dropbox.com/s/whiyjjsnj37d97v/GunAngle2.capx?dl=0
B
38
S
22
G
51
Posts: 211
Reputation: 29,505

Post » Fri Jul 21, 2017 3:46 pm

Thank you! I was messing around with the flip action as well, as hoping I would have to use it because I'll actually be pinning the head to the body. I'll just figure something out with imagepoints I suppose.

Thank you!
B
15
S
7
G
2
Posts: 5
Reputation: 2,187

Post » Fri Jul 21, 2017 7:38 pm

Cool man, I'm glad it helped you
B
38
S
22
G
51
Posts: 211
Reputation: 29,505


Return to How do I....?

Who is online

Users browsing this forum: mekonbekon, yippiez and 11 guests