Console output:
(unnecessary repetition removed)
Code: Select all
HADOUKEN!
--------------------------------------
Booting...
Game
GLFW
Window opened
Audio ( ALUT )
Media engine
Font
Interface
Gamepads
Physics (Chipmunk Game Dynamics)
DONE
--------------------------------------
Arena made
step
step
step
step
step
Pos: 151.000000, -32.000000 Angle: 0.000000 Vels: 0.000000, 0.000000
step
Pos: 151.000000, -32.000000 Angle: 0.000000 Vels: 0.000000, 0.000000
step
Pos: 151.000000, -32.000000 Angle: 0.000000 Vels: 0.000000, 0.000000
step
Pos: 151.000000, -32.000000 Angle: 0.000000 Vels: 0.000000, 0.000000
step
--------------------------------------
Shutting down...
Chipmunk slaughtered.
Pads yanked.
Interface killed.
Font unloaded.
Media engine stopped.
Audio safely shut down.
Window closed.
GLFW safely shut down.
Game killed.
Process returned 0 (0x0) execution time : 6.734 s
Press any key to continue.
Code: Select all
cpInitChipmunk();
printf( "Physics (Chipmunk Game Dynamics)\n\t" );
Code: Select all
cpsArena = cpSpaceNew();
cpsArena->gravity = cpv( 0, -100 );
printf( "Arena made\n" );
Code: Select all
tsMyInstance->cpbBody = cpBodyNew(100.0, cpMomentForCircle(100.0,20.0,0.0f, cpvzero));
// Set the initial position
tsMyInstance->cpbBody->p = cpv(si16MouseX,si16MouseY);
// Add the body to the space
cpSpaceAddBody(cpsArena, tsMyInstance->cpbBody);
// Create our shape associated with the ball's body
cpShape * cpsCircle = cpCircleShapeNew(tsMyInstance->cpbBody, 20.0, cpvzero);
cpsCircle->e = 0.5; // Elasticity
cpsCircle->u = 0.8; // Friction
// Add the shape to out space
cpSpaceAddShape(cpsArena, cpsCircle);
Code: Select all
printf( "step\n" );
cpSpaceStep(cpsArena, 1.0/60.0);
The demos work really well after some slight adjustments are made to compensate for a lack of function overloading in my GCC. So it's not outside of my code, whatever it is.