How does a "coilgun" work?
A coilgun is a series of coils that are successively energized as a conductive projectile made from magnetic material passes by them.



Each stage acts on similar principles to those of a solenoid. Current loops induce magnetic flux through their center:


As the conductive projectile approaches the air-core current loops, two things happen: the loop inductance increases and the projectile becomes magnetized. The magnetized projectile is then attracted to the loop magnetic field, accelerating towards it. As it approaches, inductance increases, completing a positive feedback loop such that the pull on the projectile and magnetic field created by the loops increase.


This process reaches a peak when the projectile is completely enclosed by the coil, where further travel decreases the loop's inductance. At this point, current through the loop is abruptly turned off so the projectile won't be slowed down by its continued attraction to the coil's magnetic field.
 


These are the basic physics principles by which a coil gun operates, which appears to be what you are interested in. There are many practical implementations.