Exemple #1
0
int main()
{
	iSetTimer(1000,timecount);
	initialize_car();
	iSetTimer(500,cursor2);

	iSetTimer(100,blink);
	iInitialize(1000,700,"car racing");

	system("taskkill /f /im wmplayer.exe");
	
	return 0;

}
int main()
{

	end_simulation = 0; 

	/* allegro library initialization */
	allegro_init();
	/* keyboard initialization */
	install_keyboard();

	/* 32 bit color depth definition */
	set_color_depth(32); 
	/* palette definition */
	set_palette(colors); 
	
	/* graphic mode initialization (MAX_LENGTH*MAX_WIDTH) window definition */
	if (set_gfx_mode(GFX_AUTODETECT_WINDOWED, MAX_LENGTH, MAX_WIDTH, 0, 0) < 0) 
		exit(-1);

	/* definition of bitmap buffer dimensions */
	buf = create_bitmap(MAX_LENGTH, MAX_WIDTH); 
	/* clear the buffer */
	clear(buf); 

	/* structures initialization */
	init_cartypes();
	initialize_car(&car, &cartypes[0]);

	/* threads creation */
	create_threads(&car);	

	while (!key[KEY_ESC]); 

  	destroy_bitmap(buf);

	return 0; 

}