After lots of rooting around I found this that I made back in 2007.
I wasn't that organised back then but this should give you some ideas of how you could do it.
`------------------------
` STICKMAN SKELETON
` By OBese87
` 5th Aug 2007
`------------------------
hide mouse
white = rgb(255,255,255)
red = rgb(255,0,0)
green=rgb(0,255,0)
yellow = rgb(255,255,0)
`SIMPLE VERSION OF ONE JOINT
maxjoint=14
DIM Joint(maxjoint,4) : rem 0=Xpos, 1=Ypos, 2=Angle, 3=Limb_Length, 4=Parent
`Waist (Root)
Joint(0,0)=320 : Joint(0,1)=240
`Right Knee
Joint(1,2)=30 : Joint(1,3)=20 : Joint(1,4)=0
`Right Foot
Joint(2,2)=-30 : Joint(2,3)=20 : Joint(2,4)=1
`Left Knee
Joint(3,2)=-30 : Joint(3,3)=20 : Joint(3,4)=0
`Left Foot
Joint(4,2)=30 : Joint(4,3)=20 : Joint(4,4)=3
`Spine 1 (Lumbar)
Joint(5,2)=180 : Joint(5,3)=10 : Joint(5,4)=0
`Spine 2(Thoracic)
Joint(6,2)=0 : Joint(6,3)=10 : Joint(6,4)=5
`Spine 3 (C)
Joint(7,2)=0 : Joint(7,3)=10 : Joint(7,4)=6
`Right Shoulder
Joint(8,2)=92 : Joint(8,3)=10 : Joint(8,4)=7
`Right Elbow
Joint(9,2)=0 : Joint(9,3)=10 : Joint(9,4)=8
`Right Hand
Joint(10,2)=0 : Joint(10,3)=10 : Joint(10,4)=9
`Left Shoulder
Joint(11,2)=-90 : Joint(11,3)=10 : Joint(11,4)=7
`Left Elbow
Joint(12,2)=0 : Joint(12,3)=10 : Joint(12,4)=11
`Left Hand
Joint(13,2)=0 : Joint(13,3)=10 : Joint(13,4)=12
`Head
Joint(14,2)=0 : Joint(14,3)=10 : Joint(14,4)=7
sync on
`------------------------
` MAIN LOOP
`------------------------
DO
cls
print "FPS: "; screen FPS()
If mouseclick()=1
`Check joints
For j = 1 to maxjoint
if ABS(mousex()-Joint(j,0))<=5 and ABS(mousey()-Joint(j,1))<=5 and rotate=0
rotate = 1 : rj=j
endif
Next j
Endif
if rotate=1
print "Rotating Joint " ; rj; ": "; Joint(rj,2)
if mouseclick()=0 then rotate=0
m= wrapvalue( mousemovex() )
Joint(rj,2) = wrapvalue( Joint(rj,2)+m )
endif
`Draw Limbs
For lmb = 1 to maxjoint
a=0
par=lmb
While par<>0
a=a+Joint(par,2)
par=Joint(par,4)
Endwhile
par=Joint(lmb,4)
Joint(lmb,0) = Joint(par,0)+sin(a)*Joint(lmb,3)
Joint(lmb,1) = Joint(par,1)+cos(a)*Joint(lmb,3)
ink red,0
~dline( Joint(par,0),Joint(par,1),Joint(lmb,0),Joint(lmb,1) )
` line Joint(par,0),Joint(par,1),Joint(lmb,0),Joint(lmb,1)
Next lmb
circle Joint(14,0),Joint(14,1),4 : `head
For jnt = 0 to maxjoint
`draw joint
ink white,0
if rotate=1 and jnt=rj
circle Joint(jnt,0),Joint(jnt,1),1
else
Dot Joint(jnt,0),Joint(jnt,1)
endif
Next jnt
circle Joint(0,0),Joint(0,1),3
`Mouse
ink yellow,0
circle mousex(),mousey(),6
sync
LOOP
END
`------------------------
` FUNCTIONS
`------------------------
FUNCTION ~dline(l,t,r,b) : `sp is for dotted lines!
sp=1
w = r-l : h = b-t
if w >= 0 then xstep = 1*sp else xstep = -1*sp
if h >= 0 then ystep = 1*sp else ystep = -1*sp
w# = ABS(w) : h# = ABS(h)
if w#=0 then w#=0.1
if h#=0 then h#=0.1
xfact# = w#/h#
yfact# = h#/w#
x = 0 : y = 0
repeat
`don't overshoot
if abs(x+xstep) > abs(w) then xstep = 0
if abs(y+ystep) > abs(h) then ystep = 0
dot x+l,y+t
if yfact# > xfact#
inc y,ystep
if ABS(x) < ABS(y*xfact#) then inc x,xstep
else
inc x,xstep
if ABS(y) < ABS(x*yfact#) then inc y,ystep
endif
until xstep = 0 and ystep = 0
ENDFUNCTION
"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright