How do I fix my 8 directional movement

0 favourites
  • 8 posts
From the Asset Store
A pack that contains fully customizeable top down/4 directional zombie sprites for creating horror games
  • 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 ?

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

  • - 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"

  • - 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

    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"

  • 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"

  • 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.

  • Now I get it. Try this capx:

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

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)