What is the best way for an enemy to get around walls in a Top Down game? [SOLVED]

0 favourites
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • Do you need only the graphics to turn in 4 directions, or do you want to restrict the movement to only Up, Left, Right and Down?

  • Do you need only the graphics to turn in 4 directions, or do you want to restrict the movement to only Up, Left, Right and Down?

    Both things, but only the necessary programming to make it functional in this way.

  • Adding this should help you achieve the effect:

    Also consider increasing the rotation speed so the characters quickly snap into the correct angle.

    As for the animations, all you need to do is check the angle of the Player/Enemy Controllers and apply the animation to the characters based on that.

    - For example, if Enemy_Controller angle is between 315 and 45, set Enemy animation to "Right".

    You can use the condition "Pick Children" to access the Graphic object belonging to the controller.

    - For example: Condition1 -> Enemy_Controller -> Pick Children -> Enemy.

    Condition2 -> Enemy_Controller angle is between 315 and 45

    Action: Enemy -> Set Animation to "Right"

    Since you used the Condition 1 to specifically pick the child of the Enemy_Controller, it will only change the animation if it's its own child.

    Same applies to the Player.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Like this:

    I also made some adjustments to the demo which include this, and made some tweaks to some values, such as the pathfinding refresh rate. It was at every 0.02 seconds, but that appears to be pretty memory heavy so I changed it to 0.05.

    It also seems to work better with 4 directional movement.

    drive.google.com/file/d/1nDI-BU8huVVyZSzPvkEFd0nZLw6xFY-e/view

  • Adding this should help you achieve the effect:

    Also consider increasing the rotation speed so the characters quickly snap into the correct angle.

    As for the animations, all you need to do is check the angle of the Player/Enemy Controllers and apply the animation to the characters based on that.

    - For example, if Enemy_Controller angle is between 315 and 45, set Enemy animation to "Right".

    You can use the condition "Pick Children" to access the Graphic object belonging to the controller.

    - For example: Condition1 -> Enemy_Controller -> Pick Children -> Enemy.

    Condition2 -> Enemy_Controller angle is between 315 and 45

    Action: Enemy -> Set Animation to "Right"

    Since you used the Condition 1 to specifically pick the child of the Enemy_Controller, it will only change the animation if it's its own child.

    Same applies to the Player.

    Thanks again! You're awesome! :D

  • Like this:

    I also made some adjustments to the demo which include this, and made some tweaks to some values, such as the pathfinding refresh rate. It was at every 0.02 seconds, but that appears to be pretty memory heavy so I changed it to 0.05.

    It also seems to work better with 4 directional movement.

    https://drive.google.com/file/d/1nDI-BU8huVVyZSzPvkEFd0nZLw6xFY-e/view?usp=drive_link

    Thank you very much!!! :D

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