This is the basic layout of my game: http://www.youtube.com/watch?v=qcd-CcKWjGU&feature=youtu.be
To make him move I just made it so you click left or right to move, just for a test.
Anyway, I just need an idea on what I need to do to the enemy follow the player. I'm not sure what variables I need and if I need some sort of angle variable so he can move in all possible direction. I probably just want to start out by making it follow the player on the x direction and then start making him move towards the player. This is my first time really having ago at proper AI as the last game I made invlolving AI what just making the enemy move right and turn left once reaching a certain point and vice versa.
This is all really have so far:
rectangle = new Rectangle(
(int)position.X,
(int)position.Y,
texture.Width,
texture.Height);
float et = (float)gameTime.ElapsedGameTime.TotalMilliseconds;
position += velocity;
if (InputManager.Instance.KeyDown(Keys.Left))
velocity.X = -3f;
else if (InputManager.Instance.KeyDown(Keys.Right))
velocity.X = 3f;
if (velocity.X > 0)
facingRight = true;
else if(velocity.X < 0)
facingRight = false;//This is just so that the enemy will look in the right direction of the way he's moving.
I also have an origin which is a Vector2 of the enemy's centre which I feel I may need.