Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I thought I'd manage to make sense of the codešŸ¤£I can't because I've never seen a single line of C beforešŸ˜¬from looking into it, I don't know what the nodes would be for my algorithm? Would I use a tilemap or would soemthing else be better to use? 

(2 edits)

Forget the abstract concept of ā€œnodesā€. Youā€™re using tiles, so just think of them like that.

You need a set of ā€œopen tilesā€ and ā€œclosed tilesā€, and both kinds hold the position of said tile, the position of its parent tile, and the cost of getting to that tile.

When the algorithm starts, your open tile set contains the starting point. After that the algorithm will naturally expand outwards by querying neighboring tiles, which are very easy to find on a tilemap.