Recent studies have shown that many major signalling pathways involved in embryonic development are ancient, and likely evolved before or at the onset of multicellularity. In the unicellular ancestors, these pathways may have been involved in regulating their ecological interactions. To understand the early evolution of development, we therefore need to study how the ancestral genetic toolkit was co-opted to coordinate nascent multicellularity in this ecology-to-development transition. We construct an evolutionary cell-based model in which cells use their genetic toolkit to compete for resources in a spatially structured environment. First, we let unicellular ancestors evolve a genetic toolkit that enables them to survive by regulating their behaviour in response to the environment. Then, when adhesion can evolve, we find that adhering groups of cells interpret environmental cues more effectively than their unicellular ancestors, which enables them to locate resources more quickly; this selects for multicellularity. Once cells have evolved multicellularity, their genetic toolkit evolves to a drastically different strategy from the unicellular ancestor, resulting in striking patterns of spatio-temporal cell state changes that visually resemble animal development. Surprisingly, these coordinated patterns are not a consequence of cells cooperating with each other. Rather, they result from cells using their genetic toolkit to compete with other cells in the cluster, selfishly maximising their own reproductive success. Our model demonstrates how emergent selection pressures at the onset of multicellularity can drive the evolution of the ecological interactions between cells to give rise to developmental pattern formation.