How do I make my char mirrored with pathfinding

Get help using Construct 2

Post » Sat Sep 12, 2015 12:28 am

So, i just added enemy ai with pathfinding, everything good so far, the animation "moving" plays when the enemy is following the path , but the sprite is facing left, when he moves right he looks like he is moonwalking (hahaha) i want to set mirrored the sprite but i cant find a way! can anybody help me? :C
B
4
Posts: 7
Reputation: 219

Post » Sat Sep 12, 2015 12:35 am

so u have the left animation but not the right... try using the sprite.mirror self thing when the direction of movement is toward right... youd have to know the angle is traveling at though if it wold be triggered by keyboard wold be much easier.. but since you have it automatically in an AI system which doesnt depend on ur input.. u need to always check the angle of movement.. one way is to use a custom behavior called speedmonitor which monitors the speed and angle of movement of the object.. and u can use those values in a expression to make the character mirror the animation
B
70
S
20
G
67
Posts: 1,314
Reputation: 42,301

Post » Sat Sep 12, 2015 1:23 am

I fixed it!! i make it work with comapring the x position of the sprite, if the x position is greater than before it measn that the sprite should be mirrored! yei! thanks for the reply! you gave me the idea when you said "u need to always check the angle of movement"
B
4
Posts: 7
Reputation: 219

Post » Wed Mar 15, 2017 12:00 pm

Hey I'm having the same problem you had but I can't figure out how to make it compare the sprites X to is previous X position. Can you please show the condition you used (compare X to ?) Thanks
B
6
S
1
Posts: 14
Reputation: 375

Post » Thu Mar 16, 2017 10:11 am

jskocdopole wrote:Hey I'm having the same problem you had but I can't figure out how to make it compare the sprites X to is previous X position. Can you please show the condition you used (compare X to ?) Thanks


Hey jskocdopole, here's what you do.

Create a Decoy follower sprite that follows your main pathfinding sprite wherever it goes maintaining a small relative pixel distance to be used for determining an artificial 'angle of motion.'

Check out this example.
https://www.dropbox.com/s/3gelkszlyl6e2 ... .capx?dl=0

This is one applied to a 'Drag and Drop' sprite but the concept is the same.
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Thu Apr 20, 2017 12:04 pm

Thanks for the info, I think some of my more advanced students could use this
B
6
S
1
Posts: 14
Reputation: 375


Return to How do I....?

Who is online

Users browsing this forum: Davlin, Madave96 and 6 guests