In the traditional approach to evolutionary game theory, the individuals of a population meet each other at random, and they have no control over the frequency or duration of interactions. Here we remove these simplifying assumptions. We introduce a new model, where individuals differ in the rate at which they seek new interactions. Once a link between two individuals has formed, the productivity of this link is evaluated. Links can be broken off at different rates. In a limiting case, the linking dynamics introduces a simple transformation of the payoff matrix. We outline conditions for evolutionary stability. As a specific example, we study the interaction between cooperators and defectors. We find a simple relationship that characterizes those linking dynamics which allow natural selection to favour cooperation over defection.