How do I make sprite turn left/right in an 8 dir movement?

0 favourites
From the Asset Store
A complete set of graphical user interface (GUI) to build 2D video games. With wood, nature, & jungle theme
  • After searching here and googling this and checking out many examples and reading explanations I still can't figure out how to do this in Construct.

    I have an 8 dir animation for the sprite and want an 8 dir movement.

    This is what I would wish for the sprite movement:

    Every time I press the right arrow key the sprite turns right (in 45 degree intervals). Same with left arrow key - sprite turns left. Up-key gives speed and down key stops the sprite.

    Any advice, links and suggestions much appreciated.

  • does it have to be using 8 direction behaviour ?

    https://goo.gl/fvLbQS

  • No not at all as long as it corresponds to my 8 dir animations. IYSWIM

    Couldn't open your file because it's saved with a newer version of Construct. I'm using the latest (I think) stable version 212.2. I don't want to use a beta version just now.

  • does it have to be using 8 direction behaviour ?

    https://goo.gl/fvLbQS

    No not at all as long as it corresponds to my 8 dir animations. IYSWIM <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Thank you for the example but I couldn't open your file because it's saved with a newer version of Construct. I'm using the latest (I think) stable version 212.2. I don't want to use a beta version just now. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • How to open newer versions of capx files

    unzip the capx and edit the caproj file in a text editor

    find where is says (for example)

    <saved-with-version>21100</saved-with-version>

    and replace with an older number eg

    <saved-with-version>17000</saved-with-version>

    save and try

    Search the forum for more information about opening newer versions in old versions.

  • Brilliant! Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Looks like it's exactly what I need. Thank you so much. <happy dance>

  • This movement is just what I am looking for.

    But (isn't there always), when I try to add my sprite with directional animations the directions get scrambled. I have been at it all day trying loads of ways and examples but can't make it work.

    The 8 directions using arrow keys, speed up and stop down, turning right/left and with animations ought to be a basic thing "out of the box" but I find it too complicated for my simple brain. And it seems I'm the only one needing this.

    Any suggestions and push in the right direction much appreciated.

    Was going to attach a file but apparently I have not posted enough yet.

  • are they animations or just frames (eg facing left , up, etc) ?

  • Each of the 8 direction animations have 8 frames.

    Am not sure I use the right expressions for C2, am used to other engines. sorry.

  • No need to apologise for using another engine <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> (I have also used in the past ! (STOS and AMOS as I recall ))

    Right not fully checked and there are better ways to do this (but this should be easy to follow)..

    https://goo.gl/QP7ltB

  • Wow thank you!

    When I run the example I get 1 color for each direction, is that what it is suppose to do?

  • yep - that is about as good as my animation gets

    double click on the sprite (arrow) and you will hopefully see the sprite editor which should show a list of 8 animations (Animation0-Animation7). If you click on one of these in the list you should see a strip of arrows at the bottom of the page (animation frames) this is where your animation will live (one strip for each direction) As I have the speed set to 0 in the animation properties (left side of screen) the animation does not play. try altering this speed for animation0 up to 25 - then (when run) the arrow should change colour (note the "u" ) when facing right.

  • Great.

    I exchanged your animations with mine and it goes giddy up.

    Am uploading the file to my server space and will PM the link to you, if that is ok with you? Just so you can tell me if it behaves strange at your end too or if it is my computer (can't be me) doing it.

  • Eisot you will find many demo with this link

    https://www.dropbox.com/sh/eioscti86bpr ... 7YPza?dl=0

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