Perfectly Straight Path

0 favourites
  • 4 posts
From the Asset Store
Move around the rectangular and travel as much as you can!
  • I've done some searching, but haven't found an answer. I feel like i'm missing something simple.

    I'm trying to replicate a right to left behavior like Plants vs. Zombies.

    My enemy goes from the start node, to the end node. The nodes are perfectly lined up on the Y in a grid.

    But it tends to slope down slightly as it moves along. Not in a straight line.

    I've created a simple square "enemy" and gave it a pathfinding behavior.

    On start of layout it finds path to the X and Y of the "end" node.

    And then On pathfinding path found, it moves along path.

    Any help is appreciated!

    ~Rich

    Tagged:

  • If you're trying to do something like plants vs zombies then you should really be using 8-direction behaviour with simulate left/right for simplicity of moving left or right across the screen.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the quick reply!

    Can I automate that movement for the enemy, or will I still use pathfinding?

    ~Rich

    EDIT: I removed the pathing and set 8direction is enabled with simulate 8direction pressing left.

    Looks good!

    Thanks Again!

  • No pathfinding required, I mean based on the information that I have, depends if your game is more complicated than it seems. Plants vs zombies is just simulate control left towards the left side of the screen, the action 'simulate control left' moves the enemy as though the enemy is pressing left key.

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