Reversed angle

Get help using Construct 2

Post » Mon Feb 24, 2014 7:31 pm

Hello, how do i make that spr2 will be turned to him back when spr1 is chasing him?
B
23
S
5
G
4
Posts: 142
Reputation: 3,262

Post » Mon Feb 24, 2014 7:44 pm

Impossible to say without knowing what movement model you are using.
B
71
S
21
G
229
Posts: 3,687
Reputation: 128,338

Post » Tue Feb 25, 2014 12:03 am

could you explain a little bit more what you are trying to achieve and how are you making sprites move?
B
10
S
3
Posts: 75
Reputation: 864

Post » Tue Feb 25, 2014 6:47 am

spr1 is looking at 2, and i want to spr2 move away from him
B
23
S
5
G
4
Posts: 142
Reputation: 3,262

Post » Tue Feb 25, 2014 6:51 am

Like @blackhornet said, we need to know how you make spr1 and spr2 move to answer you. If it a bullet behavior ? A platform behavior ?
Basicaly you would want to set the X and Y vector of the movement depending on the sign of (spr2.X-spr1.X) and (spr2.Y-spr1.Y) but it could also be easier with the angle of motion.... all depends on the tools you are using.
if you don't know how to explain this, try to share your file so we can take a look.
B
17
S
8
G
4
Posts: 461
Reputation: 6,157

Post » Tue Feb 25, 2014 9:09 am

just use compare x in your sprite1
if sprite1.x <sprite2.x --------- sprite2 mirror (if his original import is facing left)
----------------------------- simulate sprite2 movement to right (if using platform behavior)

dont forget to go to sprite2 settings and enable custom movement
B
15
S
6
G
4
Posts: 277
Reputation: 3,948


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests