Skip to main content

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

Great job on that wonderful adventure game!

Out of interest: How did you make the detection where the player can walk? When clicking, do you check the color of the pixel and then whether it is valid or not? If so, how do you then make the character not move over an area it can't enter? Some kind of A* star pathfinding? Or any other approach?

(+1)

Hey thanks! You're correct - I'm using an open source Javascript A* algorithm for path finding (https://www.easystarjs.com/). To set up the movement grid, for every object in the scene I specify a y-coordinate that's a "cross-over" point for the character either being in front of or behind the object. Then, for every pixel coordinate in the object below that y-coordinate, if it's not clear (alpha==0), then it gets set in the movement grid as non-walkable. Otherwise, it's a valid location for the algorithm to walk to and then gets z-ordered based on whether he's below/above that objects y-coordinate cross over point.