In this work, we study the problem of designing control laws that achieve time-varying formation and flocking behaviors in robot networks where each agent or robot presents double integrator dynamics. To design the control laws, we adopt a hierarchical control approach. First, we introduce a virtual velocity, which is used as a virtual control input for the position subsystem (outer loop). The objective of the virtual velocity is to achieve collective behaviors. Then, we design a velocity tracking control law for the velocity subsystem (inner loop). An advantage of the proposed approach is that the robots do not require the velocity of their neighbors. Additionally, we address the case in which the second state of the system is not available for feedback. We include a set of simulation results to show the performance of the proposed control laws.