Mirroring issue

Get help using Construct 2

Post » Tue Jul 05, 2016 3:24 am

I have an object that spawns from the bottom and move up at a random 260 and 280 angle (which means some go randomly slightly to the left or right as they go up).

I want the object sprite to mirror if it's going slightly to the left. Trying to make that happen.

Thank you.
B
6
S
1
G
2
Posts: 9
Reputation: 893

Post » Tue Jul 05, 2016 7:53 pm

So your angle range is centered on 270? So you just take the current random angle, subtract 270 and subtract that value from 270 to get the mirror angle.

That will mirror your object around 270.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Wed Jul 06, 2016 4:25 am

gumshoe2029 wrote:So your angle range is centered on 270? So you just take the current random angle, subtract 270 and subtract that value from 270 to get the mirror angle.

That will mirror your object around 270.


So here is the action:

https://www.dropbox.com/s/tvvxkpiueeqe0 ... 1.jpg?dl=0

if the angle of motion is between 260 and 270, i want to mirror the sprite.

I tried the math with all the Events where it checks angle. But not working how I need it.
B
6
S
1
G
2
Posts: 9
Reputation: 893

Post » Wed Jul 06, 2016 6:38 pm

I guess I am not clear on what you are trying to do. You want to create a 2nd sprite at the mirror angle at the same time as your first sprite?
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Wed Jul 06, 2016 6:46 pm

Well you just said your own logic:

+ System: Is between values (Obstacle.Bullet.Angle, 260, 270)
- Set Mirorred
+ Else
+ System: Is between values (Obstacle.Bullet.Angle, 270, 280)
- Set Not Mirorred

I guess something like this?
B
53
S
11
G
6
Posts: 133
Reputation: 8,830

Post » Wed Jul 06, 2016 7:21 pm

siks wrote:Well you just said your own logic:

+ System: Is between values (Obstacle.Bullet.Angle, 260, 270)
- Set Mirorred
+ Else
+ System: Is between values (Obstacle.Bullet.Angle, 270, 280)
- Set Not Mirorred

I guess something like this?


I got it. It was actually

Obstacle: Is between angles 270 - (Obstacle.Bullet.AngleOfMotion - 270) and 270
- Set Mirrored

Thanks for the help.
B
6
S
1
G
2
Posts: 9
Reputation: 893

Post » Thu Jul 07, 2016 4:32 am

Nice :)
B
53
S
11
G
6
Posts: 133
Reputation: 8,830


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Malhog, Ryan Kocourek and 11 guests