How to get enemies to shoot player in a top down 2d game?

I am making a top down 2d game, like the legend of zelda. How would i go about making the enemies position themselves to the top, bottom, left, or right of the player and shoot, as they can only fire in four directions?