ndouglas / downdelving-old

An experimental roguelike written in Rust.
The Unlicense
1 stars 0 forks source link

Create demo of pathfinding. #23

Closed ndouglas closed 2 years ago

ndouglas commented 2 years ago

Story

I really like the A* pathfinding demo here, so it'd be cool to replicate it as a demo within Downdelving.

Acceptance Criteria

Implementation Notes

ndouglas commented 2 years ago

https://user-images.githubusercontent.com/1318579/139553889-65312830-8237-49c2-b416-2815a9abfe90.mov

I think I improved it a bit by allowing the map to be recreated (with the R button). This works even when the player is actively following a path. I think this is just the player following the pre-generated path. What I should do is check the next square and if it's blocked, regenerate the path.

ndouglas commented 2 years ago

https://user-images.githubusercontent.com/1318579/139554822-c79ef89b-d1d3-495f-96c6-b657b241f41e.mov

Now updated to actually recalculate the path if necessary. If it can't calculate its path when the map is regenerated, it'll stop.