Yesterday my teacher was teaching about the production of photons, he told that photons are produced when the electron move from a higher energy level to a lower energy level then suddenly a idea struck in my mind that if electrons are responsible for photons and photons are responsible for electromagnetic force then how will the electromagnetic force will come between two individual protons? Is there more ways to generate photons ?