For a two-dimensional system of agents modeled by molecular dynamics, we simulate epidemics spreading, which was recently studied on complex networks. Our resulting network model is time-evolving. We study the transitions to spreading as function of density, temperature and infection time. In addition, we analyze the epidemic threshold associated to a power-law distribution of infection times.