2D Top Down AI Code To Make A Sprite Chase Another

I am making a zombie survival game but to do that I need to make an AI that makes the zombie chase the player. Does anyone know a code that could do this? It would be really appreciated! Thanks.

Hello actually I know exactly what you need. I think you need state machine. Here look at this tutorial, it really might help you a lot: