Thanks man, every star is an object that restart position when out of the view, i made 3 layers with different speeds. With vanilla JavaScript the physics is from scratch, a better way is probably using a framework.