title: Where is the right place in my code to use the Strategy pattern
body: <p>I'm new with the design pattern approach. I am designing a game called Xonix. All the Movable Object handling has quite the same coding. I want to know when it is proper to use the stategy pattern in the below code:</p>
  
  <p>Move is virtual.</p>
  
  <pre><code>void User::move(const dynamicO&amp; mo, const staticO&amp; so)
  {
      float x = 0, y = 0;
      keyboard(x, y);
      m_sprite.setPosition(x, y);
  }
  
  void User::keyboard(float&amp; x, float&amp; y)
  {
      if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) { x = -18; y = 0; };
      if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) { x = 18; y = 0; };
      if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) { x = 0; y = -18; };
      if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) { x = 0; y = 18; };
  }
  </code></pre>
  
  <p>The only thing that differs from one Object to another is the keyboard, in this case the keyboard is only for <code>User</code>, besides I omitted some extra code which is not so relevant for the question, it was more like a general question.</p>
  
  <p>So my question is, should I use the strategy pattern only on <code>keyboard</code>, or should I use it on <code>move</code> to save lines of codes from all the objects and concentrate them in one file?</p>