How do I Sense which way the player is going without using

Get help using Construct 2

Post » Sun Apr 30, 2017 7:13 am

Hi guys How do I Sense which way the player is going without using platform you see i have so code for npc's to find there way around but i need the animation to make them look like they walk down when they move down etc
Image
B
31
S
16
G
12
Posts: 318
Reputation: 9,854

Post » Sun Apr 30, 2017 9:20 am

Hi @LaurenceBedford,

If you're using the pathfinding example I posted, one way would be to pin (position only) a new sprite with the npc animations to the moving npc sprite, check the moving sprite's angle and change the animation accordingly e.g.:

If moving sprite angle between -45 and 45 set animation sprite's animation to "walk right"
If moving sprite angle between 45 and 135 set animation sprite's animation to "walk down" etc
B
22
S
9
G
4
Posts: 476
Reputation: 4,327

Post » Sun Apr 30, 2017 11:54 am

Hi @mekonbekon i am indeed using your example but using the angles doesen't seem to work
Image
B
31
S
16
G
12
Posts: 318
Reputation: 9,854


Post » Sun Apr 30, 2017 12:25 pm

Hi @Lordshiva1948 I love your tutorial but its nor exactly what I'm looking for if you take a look at this capx made by @mekonbekon his sprites move around perfectly etc but if i add this code to my RPG how would i get the NPC to play the face right animation when its moving right etc
Image
B
31
S
16
G
12
Posts: 318
Reputation: 9,854

Post » Sun Apr 30, 2017 3:03 pm

I don't see any capx you mention
B
257
S
43
G
15
Posts: 1,992
Reputation: 41,535

Post » Sun Apr 30, 2017 4:13 pm

Image
B
31
S
16
G
12
Posts: 318
Reputation: 9,854

Post » Sun Apr 30, 2017 4:14 pm

@Lordshiva1958
Image
B
31
S
16
G
12
Posts: 318
Reputation: 9,854

Post » Sun Apr 30, 2017 6:52 pm

@LaurenceBedford

Here you go, I've updated the capx to include the animations:

https://www.dropbox.com/s/42lg5xa9johbk ... .capx?dl=0

There's a separate sprite "npcanim" added to a container and pinned to the initial npc sprite that does the moving. I've set the npc sprite to invisible so that you only see the npcanim sprite.
B
22
S
9
G
4
Posts: 476
Reputation: 4,327

Post » Sun Apr 30, 2017 7:54 pm

@mekonbekon Thanks dude its brilliant your awesome at coding keep up your activity on the forums!
Image
B
31
S
16
G
12
Posts: 318
Reputation: 9,854

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests