Skip to main content
Removed not needed stuff for the question, made the title a question.
Source Link
Vaillancourt
  • 16.3k
  • 17
  • 55
  • 61

Pathfinding How can I implement path finding with obstacles between cells?

i'mI'm trying to make a game at the moment and have some trouble with the a*A* algorithm for pathfindingpath finding.

enter image description here

In the picture the orange and rainbow cells are walkableswalkable, but the orange cells have walls around them that should not be crossed but i. I don't know how to define these walls for my a*A* algorithm.

So my player is going over the wall to get to the point (red path) but iI want it to avoid the wall (green path).

I'm currently using this library: astar-javascript but iI can't define "special" cells with it that could be crossed on one side only.

If anyone has an idea, thank you :)

ps: Sorry for my english, i'm a non-native speaker/writer

Pathfinding with obstacles between cells

i'm trying to make a game at the moment and have some trouble with the a* algorithm for pathfinding.

enter image description here

In the picture the orange and rainbow cells are walkables, but the orange cells have walls around them that should not be crossed but i don't know how to define these walls for my a* algorithm.

So my player is going over the wall to get to the point (red path) but i want it to avoid the wall (green path)

I'm currently using this library: astar-javascript but i can't define "special" cells with it that could be crossed on one side only.

If anyone has an idea, thank you :)

ps: Sorry for my english, i'm a non-native speaker/writer

How can I implement path finding with obstacles between cells?

I'm trying to make a game at the moment and have some trouble with the A* algorithm for path finding.

enter image description here

In the picture the orange and rainbow cells are walkable, but the orange cells have walls around them that should not be crossed. I don't know how to define these walls for my A* algorithm.

So my player is going over the wall to get to the point (red path) but I want it to avoid the wall (green path).

I'm currently using this library: astar-javascript but I can't define "special" cells with it that could be crossed on one side only.

If anyone has an idea, thank you :)

Source Link

Pathfinding with obstacles between cells

i'm trying to make a game at the moment and have some trouble with the a* algorithm for pathfinding.

enter image description here

In the picture the orange and rainbow cells are walkables, but the orange cells have walls around them that should not be crossed but i don't know how to define these walls for my a* algorithm.

So my player is going over the wall to get to the point (red path) but i want it to avoid the wall (green path)

I'm currently using this library: astar-javascript but i can't define "special" cells with it that could be crossed on one side only.

If anyone has an idea, thank you :)

ps: Sorry for my english, i'm a non-native speaker/writer