How do I fix my 8 directional movement

Get help using Construct 2

Post » Tue Feb 16, 2016 7:00 am

So I'm trying 8 directional movement and I have run into a small issue, I do have it so that when I press up the proper animations shows when moving up as well as moving in N*E, S*W positions the only real problem I seem to have is when moving left to right my character stays in the idle animation.

I am getting the result I want just not completely i.e left to right running animations.
Am I doing this all wrong ? :P

Do I need to slice all my animations into 1 frame ?

Image
B
66
S
29
G
18
Posts: 82
Reputation: 14,105

Post » Tue Feb 16, 2016 7:47 am

@JaredX - Since your condition: (If 8direction is moving and Down arrow or Up Arrow is down) is only setting animations when down or up arrow is pressed then it will not run animations when left or right key is pressed. Is that the problem because since I can't see the animations or the other events then that is the only possible explanation I can come up with.

I suggest adding :

*If Player is moving and
*******************Right Arrow is pressed then
---------------------------------> Set animation to "RunningRight"
*******************Left Arrow is pressed then
---------------------------------> Set animation to "RunningLeft"
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
55
S
17
G
90
Posts: 1,111
Reputation: 59,145

Post » Tue Feb 16, 2016 7:54 am

chadorireborn wrote:@JaredX - Since your condition: (If 8direction is moving and Down arrow or Up Arrow is down) is only setting animations when down or up arrow is pressed then it will not run animations when left or right key is pressed. Is that the problem because since I can't see the animations or the other events then that is the only possible explanation I can come up with.

I suggest adding :

*If Player is moving and
*******************Right Arrow is pressed then
------------> Set animation to "RunningRight"
*******************Left Arrow is pressed then
-------------> Set animation to "RunningLeft"


Thanks for the fast response!
Well I tried adding "right arrow is press then do //" and it does work until I do up + right at the same time, but the problem is it gives no animation when travelling in that direction (North East - up+right) and I have no idea how to set an animation for (up+right) lol :P

I got the same result when doing "left arrow is pressed then do //"

So essential what I am trying to do is have all 8 directional movements using only these two animations "Running" & "RunningBack"
B
66
S
29
G
18
Posts: 82
Reputation: 14,105

Post » Tue Feb 16, 2016 8:15 am

@JaredX

https://onedrive.live.com/redir?resid=A ... hoto%2cpng

On the Image above I tested this event and worked properly.
Executing Animation up and down with no problem even when going right or left.

Have you tried removing the condition 8Direction is moving or not when checking for key press? and setting 8 direction angle to "none"
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
55
S
17
G
90
Posts: 1,111
Reputation: 59,145

Post » Tue Feb 16, 2016 8:23 am

chadorireborn wrote:@JaredX

https://onedrive.live.com/redir?resid=A ... hoto%2cpng

On the Image above I tested this event and worked properly.
Executing Animation up and down with no problem even when going right or left.

Have you tried removing the condition 8Direction is moving or not when checking for key press? and setting 8 direction angle to "none"


My problem is that if I add the (key is down left or right) it messes up diagonal movement and displays no animation when moving diagonally, now if I remove the (key is down left or right) it displays the diagonal animations correctly but only shows the Idle animation for basic left and right movement.

I am trying to have it so that it displays the animation diagonally as well as left and right. :3

PS : I did try replacing the entire thing with basic (key is down) events but that gave me the exact same results.
B
66
S
29
G
18
Posts: 82
Reputation: 14,105

Post » Tue Feb 16, 2016 8:30 am

@JaredX Now I get it. Try this capx:

https://onedrive.live.com/redir?resid=A ... ile%2ccapx
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
55
S
17
G
90
Posts: 1,111
Reputation: 59,145

Post » Tue Feb 16, 2016 8:34 am

@JaredX I made a capx to replicate your situation and now I understand the problem and the trick to that is to use variables to store or collect recent pressed "up or down" direction and then use them with mirror in the left or right press actions. Hope it solved the problem XD.
Last edited by chadorireborn on Tue Feb 16, 2016 8:44 am, edited 1 time in total.
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
55
S
17
G
90
Posts: 1,111
Reputation: 59,145

Post » Tue Feb 16, 2016 8:44 am

chadorireborn wrote:@JaredX I made a capx to replicate your situation and now I understand and the trick to that is to use variables to store or collect recent pressed "up or down" direction and then use them with mirror in the left or right press actions. Hope it solved the problem XD.



Heyyy you fixed it! thanks man!
Ill try to learn from your capx and get better at this :P
B
66
S
29
G
18
Posts: 82
Reputation: 14,105


Return to How do I....?

Who is online

Users browsing this forum: blissfulwizard, Google [Bot], Malhog and 16 guests