How do I do WASD animation movement?

Just started using Construct 2? Post your questions here

Post » Wed Mar 22, 2017 2:31 am

Message: maf5713 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hello,

I am just starting out and trying to do my own WASD movement. I want it to look like a 2D platformer, but move simulation 8-direction to give it more depth. This is what I have:

Image

Link to image: https://goo.gl/photos/1AQuqb2h9kHaVe8y9

What I am trying to do is have it so that if W key is pressed and Maria is in Idle animation, that she will move upward using the Right Walk animation and that if she is not in Idle animation and W key is pressed she will continue the animation she is in from A or D keys and simulate 8-direction upward. This seems to only be constantly moving her upward when she's in idle and disregarding whether the W key is pressed. What should I do to make this work?

Thank you.
B
4
Posts: 10
Reputation: 222

Post » Wed Mar 22, 2017 3:21 am

First those ELSE statements should not be in there.. Else happens if the previous condition fails.. so I'm not exactly sure what would happen with what you have there.

Secondly.. all those "is down" are NOT triggers and they are continuously being executed 60 times per second. Instead use On key pressed. On key pressed triggers one time and happens as soon as the button is down.
Last edited by jobel on Wed Mar 22, 2017 3:28 am, edited 1 time in total.
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Wed Mar 22, 2017 3:26 am

you still need isDown for the moving though.. just not for the animation triggers or mirroring for when she goes left.

make a sub event under the UP/DOWN and test for if Idle is playing, then you can decide to override with a new animation or not..
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865


Post » Wed Mar 22, 2017 10:41 am

maf5713 if you want to learn WASD movements try this tutorial

https://www.scirra.com/tutorials/5367/a ... t-2/page-2
B
256
S
39
G
15
Posts: 1,983
Reputation: 41,036

Post » Wed Mar 22, 2017 11:42 pm

Message: maf5713 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Thank you so much for replying!
Okay, I have changed it to this:

https://goo.gl/photos/bLcdJeRzHJiUzNgs8

When pushing down the W or S key alone without pressing A or D key it plays the idle animation instead of setting the animation to the new one.

Also, I am a bit confused about what you mean by the Is Down and On Key Pressed. Would I just use On Key Pressed to change the animation and then a separate one for Is Down to make the movement happen?
B
4
Posts: 10
Reputation: 222


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests