We investigate the effect of mobility on the evolution of cooperation in a flock model, where each player moves on the two-dimensional plane with the same absolute velocity. At each time step every player plays the prisoner's dilemma game and aligns moving direction with its neighbors, who are chosen according to distances in the two-dimensional space. Experimental results have shown that with unconditional cooperation or defection, cooperation can be maintained in mobile players even for high velocities, as local interactions among players are enhanced by the expansion of neighborhood. And for a fixed temptation b or absolute velocity v, there exists an optimal neighborhood size, which can induce the maximum cooperation level. Besides the model exhibits aggregation behavior, and mobile cooperators can coexist with defectors because of asymmetric neighborhood.