So far we've dealt only with constant forces. Springs are more complicated - not only does the magnitude of the spring force vary, the direction of the force depends on whether the spring is being stretched or compressed.
The spring in the simulation below has a spring constant that you should be able to determine by dragging the mass.