title: Getting my enemy to move toward my player C++
body: <p>I am trying to get my <code>Enemy</code> to move to my <code>Player</code>.</p>
  
  <p>The thing I know :</p>
  
  <ul>
  <li>The player's position</li>
  <li>The Enemie`' position</li>
  <li>The speed of the enemy</li>
  </ul>
  
  <p>The thing I need to do:</p>
  
  <ul>
  <li>Knowing the direction to the player, get the enemy to move</li>
  </ul>
  
  <p>So what I thought I needed to do is to "normalize" the enemies' position according to the players position so I know where to go, and both have a position based on <code>Vector2f</code>.</p>
  
  <p>And this is the code I have in the enemy:</p>
  
  <pre><code>void Enemy::Move()
  {
      //cout &lt;&lt; "Move" &lt;&lt; endl;
  
      // Make movement
      Vector2f playerPosition = EntityManager::Instance().player.GetPosition();
      Vector2f thisPosition;
      thisPosition.x = xPos;
      thisPosition.y = yPos;
      //Vector2f direction = normalize(playerPosition - thisPosition);
  
      speed = 5;
      //EntityManager::Instance().enemy.enemyVisual.move(speed * direction);
  }
  
  Vector2f normalize(const Vector2f&amp; source)
  {
      float length = sqrt((source.x * source.x) + (source.y * source.y));
      if (length != 0)
          return Vector2f(source.x / length, source.y / length);
      else
          return source;
  }
  </code></pre>
  
  <p>The error is :</p>
  
  <pre><code>'normalize': identifier not found
  </code></pre>
  
  <p>What am I doing wrong?</p>