As the research of topological semimetals develops, semimetals with nodal-line rings have come into people's vision as a new platform for studying electronic topology. We propose a method that uses ultracold atoms in a two-dimensional amplitude-shaken bipartite hexagonal optical lattice to simulate the nodal-line semimetal, which can be achieved in the experiment by attaching one triangular optical lattice to a hexagonal optical lattice and periodically modulating the intensity and position of the triangular lattice. By adjusting the shaking frequency and well depth difference of the hexagonal optical lattice, a transformation from Dirac semimetal to the nodal-line semimetal is observed in our system. This transformation can be demonstrated by the Berry phase and Berry curvature, which guides the measurement. Furthermore, the amplitude shaking and
C3 symmetry generate a time-reversal-symmetry-unstable mode, and the proportion of the mode and the trivial mode of the hexagonal lattice controls the transformation. This proposal paves a way to study nodal-line semimetals in two-dimensional systems, and it contributes to the application of nodal-line semimetals.