                 x image-width 2 / - 0.05 0.0 1.0 uniform-random-float * + 2 *
                 image-height 2 / y - 0.05 0.0 1.0 uniform-random-float * + 2 *
                 make-ball :> shape
-                space shape body>> cpSpaceAddBody drop
+                space shape shape>> body>> cpSpaceAddBody drop
                 space shape cpSpaceAddShape drop
             ] when
         ] each

    body -1000 -10 cpv >>p drop
    body 400 0 cpv >>v drop

    space cpCircleShapeAlloc body 8 0 0 cpv cpCircleShapeInit cpSpaceAddShape :> shape
    shape
    [ shape>> 0 >>e drop ]
    [ shape>> 0 >>u drop ] bi ;

M: chipmunk-world end-game-world
    space>>

        open-window
    ] with-ui ;

MAIN: chipmunk-demo
