A quick little ragdoll demo. Hope you like it.
REM Ragdoll Demo for Box2D by SteveW
scw=1280
sch=1024
set display mode scw,sch,32
sync on : sync rate 60 : backdrop off
REM COMMENT THE NEXT LINE TO DISABLE IMAGES
b2SetUnits 0.1,0.017453292519943295769236907684886
myworld = b2CreateWorld(-2000,-2000,2000,2000,0,500,1)
floorbody = b2CreateBoxBody(myworld,scw-50,20,0,0,0.5)
b2PositionBody floorbody,scw/2,sch-100
ink rgb(200,200,200),0
for I = 1 to 10
blockbody = b2createboxbody(myworld,75,75,.9,0,0.5)
b2positionbody blockbody,rnd(scw-200)+200,rnd(sch/2)
NExt I
for I = 1 to 10
circlebody = b2createcirclebody(myworld,15,.7,0,0.5)
b2positionbody circlebody,rnd(scw-200)+200,rnd(sch/2)
NExt I
bodyx=scw/2
bodyy=50
density#=.5
head = b2createcirclebody(myworld,20,density#,.2,.5)
b2positionbody head,bodyx,bodyy
neck = b2createboxbody(myworld,20,10,density#,.2,.5)
b2positionbody neck,bodyx,bodyy+25
neckjoint=b2createrevolutejoint(myworld,head,neck,bodyx,bodyy+20)
body = b2createboxbody(myworld,30,60,density#,.2,.5)
b2positionbody body,bodyx,bodyy+55
bodyjoint=b2createrevolutejoint(myworld,neck,body,bodyx,bodyy+30)
armru= b2createboxbody(myworld,40,10,density#,.2,.5)
b2positionbody armru,bodyx-37,bodyy+25
armrujoint=b2createrevolutejoint(myworld,armru,body,bodyx-15,bodyy+25)
armrl= b2createboxbody(myworld,40,10,density#,.2,.5)
b2positionbody armrl,bodyx-77,bodyy+25
armrljoint=b2createrevolutejoint(myworld,armru,armrl,bodyx-57,bodyy+25)
armlu= b2createboxbody(myworld,40,10,density#,.2,.5)
b2positionbody armlu,bodyx+37,bodyy+25
armlujoint=b2createrevolutejoint(myworld,armlu,body,bodyx+15,bodyy+25)
armll= b2createboxbody(myworld,40,10,density#,.2,.5)
b2positionbody armll,bodyx+77,bodyy+25
armlljoint=b2createrevolutejoint(myworld,armlu,armll,bodyx+57,bodyy+25)
pelvis = b2createboxbody(myworld,30,20,density#,.2,.5)
b2positionbody pelvis,bodyx,bodyy+95
bodyjoint=b2createrevolutejoint(myworld,pelvis,body,bodyx,bodyy+95)
legru= b2createboxbody(myworld,10,50,density#,.2,.5)
b2positionbody legru,bodyx-9,bodyy+130
legrujoint=b2createrevolutejoint(myworld,legru,pelvis,bodyx-9,bodyy+105)
legrl= b2createboxbody(myworld,10,50,density#,.2,.5)
b2positionbody legrl,bodyx-9,bodyy+180
legrljoint=b2createrevolutejoint(myworld,legrl,legru,bodyx-9,bodyy+155)
footr= b2createboxbody(myworld,20,10,density#,.2,.5)
b2positionbody footr,bodyx-14,bodyy+210
footrjoint=b2createrevolutejoint(myworld,footr,legrl,bodyx-9,bodyy+200)
leglu= b2createboxbody(myworld,10,50,density#,.2,.5)
b2positionbody leglu,bodyx+9,bodyy+130
leglujoint=b2createrevolutejoint(myworld,leglu,pelvis,bodyx+9,bodyy+105)
legll= b2createboxbody(myworld,10,50,density#,.2,.5)
b2positionbody legll,bodyx+9,bodyy+180
leglljoint=b2createrevolutejoint(myworld,legll,leglu,bodyx+9,bodyy+155)
footl= b2createboxbody(myworld,20,10,density#,.2,.5)
b2positionbody footl,bodyx+14,bodyy+210
footljoint=b2createrevolutejoint(myworld,footl,legll,bodyx+9,bodyy+200)
do
b2Step myworld
b2DrawDebugInfo myworld,0,0,1,1,1
ink rgb(200,200,200),0
b2Step myworld
rem box 50,890,1230,910
text 0,0,str$(screen fps())
text 0,20,"Esc to Exit"
sync
cls 0
loop