A decentralized feedback controller for multi-agent systems, inspired by vehicle platooning, is proposed. The closed-loop resulting from the decentralized control action has three distinctive features: the generation of collision-free trajectories, flocking of the system towards a consensus state in velocity, and asymptotic convergence to a prescribed pattern of distances between agents. For each feature, a rigorous dynamical analysis is provided, yielding a characterization of the set of parameters and initial configurations where collision avoidance, flocking, and pattern formation is guaranteed. Numerical tests assess the theoretical results presented.