animation stops when 2 buttons pressed?

Get help using Construct 2

Post » Sat Jul 27, 2013 8:31 am

I'm currently doing a top down game, using 8 directional movement, but its limited to 4 currently.

I'm using W,A,S,D keys to move the player.

If you hold 2 buttons at the same time (like A and W if you were trying to move diagonally) the characters animation stops.

I've tried telling it that if W and A are down in the same condition to play the "up" animation but it doesn't work.

Instead, his animation stops completely, but his movement still continues upward. Is there any way to fix that?
B
4
Posts: 78
Reputation: 606

Post » Sat Jul 27, 2013 9:17 am

I have exactly the same problem, when I press 2 keys at same time the animation stop in the first frame of the last button I press.
B
6
S
4
G
4
Posts: 3
Reputation: 3,031

Post » Sat Jul 27, 2013 10:00 am

Try comparing the objects VectorX and VectorY to decide which animation to play.
B
46
S
14
G
7
Posts: 603
Reputation: 8,116

Post » Sat Jul 27, 2013 10:07 am

Thanks encrypted cow! Now, forgive me for being stupid but how would I do that? Lol
B
4
Posts: 78
Reputation: 606

Post » Sat Jul 27, 2013 3:43 pm

Use the "Compare Two Values" condition in System, and check if Sprite.8Direction.VectorX > 0. If it is, that means the player is moving right. If it's less than 0, they're moving left. Then do the same for up down using VectorY.
B
46
S
14
G
7
Posts: 603
Reputation: 8,116


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, Yahoo [Bot] and 25 guests