diff options
Diffstat (limited to 'libphysics/test')
| -rw-r--r-- | libphysics/test/vis.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libphysics/test/vis.c b/libphysics/test/vis.c index 7d6466a..3111005 100644 --- a/libphysics/test/vis.c +++ b/libphysics/test/vis.c @@ -45,11 +45,12 @@ main() #define FLOAT_RAND (2 * (rand() / (float)RAND_MAX) - 1) for(int i = 0; i < SBODY; i++) { - Body *b = phxnew(BTYPE_AABB); - assert(b != NULL); + BodyID b = phxnew(BTYPE_AABB); + assert(b != -1); + phxsetpos(b, rand() % 800, rand() % 600); phxsetsize(b, 16.0, 16.0); - phxapplyaccel(b, (float[]){ 100000 * FLOAT_RAND, 100000 * FLOAT_RAND }); + phxapplyaccel(b, (float[]){ 30000 * FLOAT_RAND, 30000 * FLOAT_RAND }); } phxsetmap(8, 8, (int[]) { @@ -75,7 +76,7 @@ main() old_ticks = new_ticks; phxtick(delta); while(phxnextcollevent(&event)) { - printf("Collision with %p and %p\n", event.body1, event.body2); + printf("Collision with %d and %d\n", event.body1, event.body2); } render(); @@ -106,7 +107,6 @@ render(void) SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF); SDL_RenderClear(renderer); - SDL_SetRenderDrawColor(renderer, 0xFF, 0x00, 0xFF, 0xFF); for(int y = 0; y < phxmapheight; y++) for(int x = 0; x < phxmapwidth; x++) { |
