Player Direction

0 favourites
  • 5 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • Hey Guys and Gals

    I am working on a top down game. The player uses 8Direction Behavior for movement.

    I am using this expression for movement animations

    8Direction is moving | playerAnimations | "walk"&ceil(8*(1+player.8Direction.MovingAngle/360)-0.5)%8 (play from current frame)

    And the same expression for attack and idle as well

    player is Attacking | playerAnimations | "attack"&ceil(8*(1+player.8Direction.MovingAngle/360)-0.5)%8 (play from current frame)

    X 8Direction is moving| playerAnimations | "idle"&ceil(8*(1+player.8Direction.MovingAngle/360)-0.5)%8 (play from current frame)

    My movement animations are set as follows in one sprite:

    Walk: Attack: Idle:

    walk0 attack0 idle0

    walk1 attack1 idle1

    walk2 attack2 idle2

    walk3 attack3 idle3

    walk4 attack4 idle4

    walk5 attack5 idle5

    walk6 attack6 idle6

    walk7 attack7 idle7

    Everything is working as intended. Though when I move the player in any direction, on release of the directional button (d pad or key press) the player returns to facing to the right.

    I would like to have it where if you are in motion in a particular direction, on stopping the player would stay facing in that direction, rather than returning home.. If that makes sense.

  • Can you attach the .capx ? Just with the concerned system ? I'll have a look on it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can you attach the .capx ? Just with the concerned system ? I'll have a look on it.

    Thank you much! I appreciate it. I'm thinking I may have to create a more custom and detailed approach, but figured I'd ask for some insight incase there is a simpler way or I am just missing something.

  • Is this what you want ?

    If yes, you can avoid the globar var and add an instance variable to the player sprite, more elegant.

  • Is this what you want ?

    This is exactly what I was looking for! Yes I will be using an instance var - a lot more elegant!

    Thank you so much!

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