How To Set Angle Without Rotate The Sprite?

0 favourites
  • 3 posts
From the Asset Store
In this template the music plays without looping in your game
  • I'm using 8-directions movement on my sprite, but everytime i move my sprite, it rotate following the angle.

    If i disable the set angle in 8-directions, it doesn't rotate, but the angle will fixed at 0 degree.

    What i wanted to do is to make my sprite move in 8-direction, change the angle everytime it move to any direction, but not rotating the sprite (At least i want it to flip when it move left & right)

    Any suggestion?

  • I'm not sure what you mean. How do you "change the angle, but not rotate"?

    Do you want to set only the fixed angles - 0, 90, 180 and 270 degrees?

    You can do something like this:

    System-> Is between angles -> Sprite.8Direction.MovingAngle between -45 and 45 : Sprite set angle to 0

    System-> Is between angles -> Sprite.8Direction.MovingAngle between 45 and 135 : Sprite set angle to 90


    Or you can create different animations or animation frames for each direction:

    And then switch between them depending on MovingAngle, using the same method as above.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi Invidel,

    the sprite doesn't rotate because you only have 1 image. if you have one image then you should set it to mirrored when moving in opposite direction.

    for eg. you have 1 image which is for moving left, so in move right event you should set the image to mirror, so that it will look like the sprite is moving right and not doing moonwalk.

    1) you should have 8 sprites for 8 directional movement. eg: up, down, left, right, top left, top right, down left, down right.

    2) you should set the "set angle" property in 8 direction behavior to "No", by default this is set to 360 degrees which causes the sprite to rotate and inverts the sprite when moving at certain directions rather than showing correct sprite animation and pointing in the correct direction.

    here's my .capx file hope it helps <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> . ... TLGzkpsffH

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