How many symmetries does $D_{2n}$ have exactly? I imagine it has rotations written in the form $\frac{x\pi}{n}$ such that $x \in \{0, 1, \dots, n-1\}$, and can also be flipped.
But what about rotations reflections across lines from vertices to midpoints of opposite sides? I know this differs depending on whether $n$ is even or odd, but I still don't grasp this concept...
I assume that $D_{2n}$ refers to the symmetries of the $n$-gon (note that sometimes this group is referred to as $D_n$). For the purposes of geometric description, I will suppose that the $n$-gon is oriented with a vertex on the $x$-axis.
As you correctly note, we have rotational symmetries; there are $n$ of these. Each is a rotation by angle $\frac{2\pi}{n} \cdot x$ for $x = 0,1,\dots,n-1$.
On the other hand, we have $n$ reflection symmetries. In particular, we have the reflections across the line with angle $\frac {\pi}{n}\cdot x$ clockwise from the horizontal for $x = 0,1,\dots,n-1$. When $n$ is odd, each of these is a reflection across a line connecting a vertex to the midpoint of its opposite edge. When $n$ is even, the axis of reflection connects opposing vertices when $x$ is even and opposing edge midpoints when $x$ is odd.