Not really.
You could make an underlying grid (two dimensional array, see tutorials)
Here you place 0 for every cell he can walk and 1 for wall and 2 for health pack and 3 for weapons
So you store the Player Position also in the grid and check if a wall is ahead. Then he cannot go there