MoveTo behevior collision problem

Get help using Construct 2

Post » Sun Feb 09, 2014 11:29 am

Hi everyone,

I have a problem that has me very tired. Maybe someone can help me with it.

I did a enemy, that patrols defined area, and when the Player is in range of LOS he trying to catch him.

Problem is how to mirroring image of enemy when he moving to left or right side. I moving enemy by behevior MoveTo. So it's dosen't change angle of object. I don't have any idea how can i make to enemy know, if he moving left then mirror, and then in right not miror.

Here is a screen of my work.

wasiu92014-02-09 20:27:32
B
6
S
1
Posts: 31
Reputation: 581

Post » Sun Feb 09, 2014 11:40 am

Give the policeman an instance variable OldX and add this event

if policeman.OldX < policeman.x
-set policeman mirrored
- policeman set OldX to policeman.x
else
-set policeman not mirrored
- policeman set OldX to policeman.x
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Feb 09, 2014 11:42 am

You could also set the miirorong event together with the moveto event if you know if the destination is left or right from the current position.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Feb 09, 2014 11:51 am

What a simple solution! Thank You very much!
B
6
S
1
Posts: 31
Reputation: 581

Post » Sun Feb 09, 2014 11:56 am

Little problem have, not every time. When the policeman hit obstacle on his path then image makeing miror and notmirror at the same time.wasiu92014-02-09 11:57:48
B
6
S
1
Posts: 31
Reputation: 581

Post » Sun Feb 09, 2014 12:05 pm

I see you've already got patrol state is left and patrol state is right..
Couldn't you just use those for setting mirrored or not mirrored?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Feb 09, 2014 5:35 pm

Nov I have problem with collision of Policeman. I moving him now by moveTo behavior but it's seems that ignores solid objects.

If the player start beeing in LOS of policeman, he starts moving and it's ok. When player in that moment move and not beeing in LOS of policeman he stops on obstacle and back to patrol, OK. But when the policeman still seeing player and colides with obstacle, he's ignores solid and run through obstacle. WTF?

Here past policeman events.

wasiu92014-02-09 17:38:51
B
6
S
1
Posts: 31
Reputation: 581


Return to How do I....?

Who is online

Users browsing this forum: blue visionary and 4 guests