The barrels in Leonardo's design fan out, enabling the gun to fire upon a wide swath of enemy soldiers. With its two large wheels, it's easily towed and turned. The tall worm screw at back controls the machine gun's aim by adjusting its height. Most likely the barrels are loaded from the rear, thorugh the small door between the wheels (a technique called "breech loading"). Modern breech-loaded machine guns didn't appear until the last half of the 19th century, during the U.S. Civil War.
A flywheel (middle) is a spinning wheel. As it revolves, it stores energy like a battery, turning for a while even without a source of power. One of the oldest and most common mechanical devices, a flywheel is used in pottery wheels, gyroscopes, merry-go-rounds, and automobiles. In Leonardo's flywheel, spinning the shaft generates centrifugal force that lifts the hanging weights into a horizontal, wheel-like position. Stop spinning the shaft and it will continue to spin until it releases its energy. The weights then fall back down.
This machine (right) represents what may be the world's first design for a humanoid robot. Leonardo designed it to open and close its jaw (which was anatomically correct), sit up, wave its arms, and move its head. Automated drums may have accompanied the movement. We don't know how Leonardo planned to power his robot, but it was most likely by water or weights.