How many degrees of freedom does a diatomic molecule has in two dimension?
If we consider the diatomic molecule as a rigid body (no streching of the bond allowed), then it will have 3 degrees of freedom. To see this you can ask yourself the question "how many parameters do I need to fix the object in space?" and the answer is three: two to specify the position of the centroid of the molecule and one for the inclination angle.
If we account also the streching of the chemical bond, than the degrees of freedom will be 4, because we need one parameter more to specify the distance between the atoms.