The pioneering work by Trivers (1971), Axelrod (1984) and Axelrod & Hamilton (1981) has stimulated continuing interest in explaining the evolution of cooperation by game theory, in particular, the iterated prisoner's dilemma and the strategy of tit-for-tat. However these models suffer from a lack of biological reality, most seriously because it is assumed that players meet opponents at random from the population and, unless the population is very small, this excludes the repeated encounters necessary for tit-for-tat to prosper. To meet some of the objections, we consider a model with two types of players, defectors (D) and tit-for-tat players (T), in a spatially homogeneous environment with player densities varying continuously in space and time. Players only encounter neighbours but move at random in space. The analysis demonstrates major new conclusions, the three most important being as follows. First, stable coexistence with constant densities of both players is possible. Second, stable coexistence in a pattern (a spatially inhomogeneous stationary state) may be possible when it is impossible for constant distributions (even unstable ones) to exist. Third, invasion by a very small number of T-players is sometimes possible (in contrast with the usual predictions) and so a mutation to tit-for-tat may lead to a population of defectors being displaced by the T-players.