#include #include #include #include #include #include #include "neutronlib.h" int main(int argc, char **argv) { char c; int x, y, x1, y1, c2, chunk = 0; double rad = 0, inc = .05; minx = 0; maxx = 1920; miny = 0; maxy = 1100; // Custom screen size time_t seconds; seconds = time (NULL); unsigned int sec = seconds; srand(sec); nprot p1, p2; p1.setmass(); p2.setmass(); p1.makeprot(); p2.makeprot(); p1.x = 200; p1.y = 380; p1.rad = .2; p2.x = 600; p2.y = 420; p1.vt = 2; p2.vt = 2; p2.rad = PI + .2; control c1; if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) { printf("Could not initialize SDL: %s.\n", SDL_GetError()); exit(-1); } init_screen(maxx, maxy); color = 0x008800; ColorFill(color, maxx, maxy); while(1){ ColorFill(color, maxx, maxy); p1.move(); p2.move(); p1.bump(p2, c1); c = keystroke(); if(c == 'q') break; if(c == 'w') SDL_Delay(10000); SDL_UpdateRect(screen, minx, miny, maxx, maxy); SDL_Delay(50); } SDL_Quit(); }