Mirror image points?

Get help using Construct 2

Post » Sat Oct 05, 2013 4:20 pm

Hello, I'm having some trouble getting my arm sprites to appear mirrored along with the body.

So far I'm mirroring the player when facing left(A is down) and the arms are set to angle towards the Mouse position.

Because of the angling, the arms are already facing the right way when shooting left so I cannot mirror them or they will appear backwards!

An image of the issue:


Facing right


The problem seems to be that the arms are still pinned to the non-mirrored image point.

Here's my event sheet:


I tried setting the X position for when facing left:



and even tried a separate image point, but to no avail.

https://www.dropbox.com/s/lmou2huc4bqtadp/myproject.capx
B
25
S
6
G
3
Posts: 197
Reputation: 3,355

Post » Sat Oct 05, 2013 7:30 pm

If you want to move a pinned object then you need to pin it again after you move it.

So try doing 'set position to image point 2 / pin to player' after flipping the arms.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Sat Oct 05, 2013 9:05 pm

Pin has some benefits. However my experience is that Pin is only good for more LOCKED objects. Objects you don't intend to need to rotate, move in any more way.

However if you need an an object like arms to stay at a certain image point. Your better off just leaving it in an auto update tick to reset the position.

Since Pin has to set the new position anyways. Doing it manually has no over head loss.

soo

this is done every tick
arm.setposition(player.imagepoint("arms")


on Face Change
player.mirror(yes)
arms.mirrot(yes)
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Sun Oct 06, 2013 1:01 pm

Ah, I see... was trying to avoid an every tick method assuming it'd use more memory but tried it anyway and it's working great!

Will keep the Pin info. in mind.

Thanks to both of you
B
25
S
6
G
3
Posts: 197
Reputation: 3,355


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Casimir, Syazanie Amirin, tarek2 and 8 guests