Help plz ,8 way movement isometric style hack N slash

0 favourites
  • 8 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • trying to build a 8 way movement with arrow keys but my issue is switching from upleft to upright , and going to like right then rightdown rotating clockwise and counter sometimes it hangsup

    you can see how i'm trying to achieve this in my project but i thought there might be an easier way and i'm not fully understanding how it should be programmed

    I currently dont have the UP and the LEFT or RIGHT animations yet but i was just toying around with what i got so far

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I recommend creating a player base (an arrow graphic or whatever you prefer)

    Add 8-direction walking behaviour to this player base.

    Add a variable to this base, and create events which check the angle of your player base.

    In the end you could set variables (0-8 or up, down etc.... whatever you prefer) based on the current walking angle.

    That's not that complicated.

    Ones you're done with that.

    Simply PIN your player drawing (animation) to the player base.

    Then simply check the player base variable to set the animation accordingly.

    With that, there's no need to check any button pressed at any given time.

    I found this tutorial which should help you through this process in more detail:

    https://www.scirra.com/tutorials/413/di ... -animation

  • I dont fully understand and the tutorial is helping some but not sure what do put for angles i assume like 45 degrees should work, thanks Everade. I'm trying to figure this on my own as you said this isn't complicated but i'm still fairly new in learning things on construct

  • Awesome I got it and here is my post of what i got so far! Thanks Everade

  • I've made some small improvements to your code and:

    • Edited Origin of player sprite so the player base is at the feet of the player sprite (since it should be the players actual position on the ground in case you walk into solid objects)
    • Added a stone as a solid object editing it's collision polygons. So you're colliding with the stone with your feet location properly

    The "trigger once" will be important as soon as you've added an animation to the character. Otherwise the animation will restart every tick (so you will think the animation will not work but it's actually just restarting the animation about 60 times per second)

    I recommend to download the Z-Sorter plugin from Rex.

    Using this plugin allows you to automatically change the z-order of your player sprite (or anything else that's moving) based on their Y position on the layout.

    So right now in the example i've sent you you will notice that it looks correct if you walk BEHIND the Stone.

    But as soon as you walk in front of it your character will still be behind the rock.

    Using Z-Sorter plugin will help you to get this properly done <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    http://c2rexplugins.weebly.com/rex_zsorter.html

    Personal tip:

    In case some animations are visually exactly the same (for example walking left or right).

    Do not create another animation for it... this will only steal resources which isn't required.

    You could simply MIRROR the animation instead using an event.

  • OK here is my template character i got all the animated sprites now .... so what im trying to do now is when i release a movement key have a last check for the position change or some how have my character stand in position he was last moving in. Thanks for the recomendation i'll try that Z-order and i'll also check the file that you fixed so kindly for me . i plan on buying construct 2 soon so using an extra code shouldnt matter to me. but its nice to see when i can reduce resources like you said ive only toyd around with construct for about a few months total between both of my projects

    thanks a bunch! if you got skype i'd love to chat with you too if you dont mind

  • There you go

    However no skype, i have way to much to do for myself.

    I'm a beginner myself, i can't teach you much anyways

  • WOW i finally lookd at the work thats great and i learned , thanks a ton for the help

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