In this paper, we develop an energy dissipative numerical scheme for gradient flows of planar curves, such as the curvature flow and the elastic flow. Our study presents a general framework for solving such equations. To discretize time, we use a similar approach to the discrete partial derivative method, which is a structure-preserving method for the gradient flows of graphs. For the approximation of curves, we use B-spline curves. Owing to the smoothness of B-spline functions, we can directly address higher order derivatives. In the last part of the paper, we consider some numerical examples of the elastic flow, which exhibit topology-changing solutions and more complicated evolution. Videos illustrating our method are available on YouTube.2010 Mathematics Subject Classification. 65M60, 35A35, 53C44.