How do I Rotate 8Directional movement against Solid Objects

0 favourites
  • 5 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Howdy!

    I've recently picked up Construct again to fidget with it, despite owning it for a while I never really decided to -DO- anything with it at all.. And had figured that replicating the combat from Oracle of Ages/Seasons would be a fitting challenge to get started with a new system. (Bear in mind, while I have little experience with Construct itself I have dabbled in the logic of game creation for a while, I might not be an expert but I do have some experience.)

    The result is as follows: https://dl.dropboxusercontent.com/u/711 ... index.html

    (Arrow keys to move, Control to attack. Spin charge works. You can't die, but the enemies can)

    I've hit a bit of a wall (pun intended) though. the 8Directional movement Behaviour (using a 90 degree angle shift, not full rotation) does not rotate when the object is against a solid. And while I partially understand why it doesn't rotate (as it rotates, and doesn't just snap into an angle internally) I can't say it is the behaviour I want to see, as my animation depends on this angle.

    Is there a way to make it rotate when another side is against a wall, or am I better off adding custom movement behaviour and fidgeting with this to get it to work my way?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I played it for a bit (longer than I should have....) It looks and feels right to me. I tried to get it to get weird against objects but it functioned like I thought it should for a N,S,E,W control. What am I missing?

  • When facing in a direction that is at a 90 degree angle from a wall while against it, and then walking INTO said wall the 8Directional movement object doesn't appear to rotate properly, causing this to happen:

    I'm walking to the left, but because it never seems to rotate the animation played isn't set to the right direction. It's not that my events don't catch it, as there's situations for both moving and not moving.

    Or perhaps I am missing something here?

    (PlayerController is an invisible object that the object Link pins to, it's just a sprite with animations and no logic)

  • The 8direction behavior only sets the angle when moving. What you want to do is set the angle based on what arrows are pressed.

    https://dl.dropboxusercontent.com/u/542 ... angle.capx

  • That was part of an assumption I made, and it unfortunately seems to be true. I suppose it's an easy fix then, set the angle when a button is pressed.

    Much appreciated.

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