[Solved] Mirroring Image Points when the sprite is mirrored

Just started using Construct 2? Post your questions here

Post » Tue Dec 23, 2014 2:55 am

I've run into trouble with my platformer player. The player controller is a basic box sprite. There is an origin point on the right side of the box for a fireball attack so when the fireball is spawned it does not spawn inside of the player box.

This is perfect when the player box is facing right, but when the player is facing left, the image point origin is still on the right side of the player box.

Because of this, when the player shoots while facing left, the fireball is created inside of the box and not outside of the box.

I tried to find a way to edit the origin as an action on my Left Arrow Pressed > Set Player Sprite Mirrored event, but I couldn't find any results. Can someone help me out here? I imagine this is a very basic, yet common problem for anyone who's made a platformer with projectile-weapons.
Last edited by General J on Wed Dec 31, 2014 9:16 pm, edited 1 time in total.
B
20
S
5
Posts: 108
Reputation: 1,473

Post » Tue Dec 23, 2014 12:03 pm

you could do it like this. Merry Christmas
You do not have the required permissions to view the files attached to this post.
B
255
S
39
G
15
Posts: 1,982
Reputation: 41,005

Post » Wed Dec 31, 2014 9:15 pm

I'm bumping because I fixed the problem and I thought I'd share it in case others might have the same problem.

Thanks for making a demo, but it didn't fix it and I think that's due to me not describing the problem in enough detail.

This is for a 2D Platformer-based game type. The trick is to make sure "Set Angle" in the Bullet Behaviors is set to "No", and mirror the bullet sprite when the player is mirrored.

Image

I hope this helps.
B
20
S
5
Posts: 108
Reputation: 1,473

Post » Mon Dec 05, 2016 5:30 pm

This works perfect, thanks!
General J wrote:I'm bumping because I fixed the problem and I thought I'd share it in case others might have the same problem.

Thanks for making a demo, but it didn't fix it and I think that's due to me not describing the problem in enough detail.

This is for a 2D Platformer-based game type. The trick is to make sure "Set Angle" in the Bullet Behaviors is set to "No", and mirror the bullet sprite when the player is mirrored.

Image

I hope this helps.
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,268


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests