Пример #1
0
void fading(float f) {
		fillwithcolor(0, 0, 0, f);
}
Пример #2
0
void atomicdetonation()
{
	//TIMER RUNS DOWN, SHOWS "DETONATION", THEN A FLASH AND BOOM. FLASH THE CONSOLE WITH GREY - WHITE - GREY - BLACK
	
	int seconds;
	int split;
	int hcenter;
	//	unsigned int i;
	int thcenter;
	int vcenter;
	//00:00.01 kinda like that
	char timebuf[20];
	char *detonationstring = "D E T O N A T I O N";
	char *missioncompletestring = "M I S S I O N    C O M P L E T E";
	COORD consize;
	
	cls();
	consize = getconsize();
	//	cursorhide();
	hcenter = ((consize.X) / 2);
	vcenter = ((consize.Y)/ 2);
	seconds = 2;
	split = 99;
	
	while (seconds > 0 || split > 0){
		split--;
		if (split < 0){
			seconds --;
			split = 99;
		}
		sprintf(timebuf, "00:%2.2d.%2.2d", seconds, split);
		thcenter = hcenter - (strlen(timebuf) / 2);
		setcursor(thcenter, vcenter);
		LRED;
		printf("%s", timebuf);
		Sleep(10);
	}
	thcenter = hcenter - (strlen(detonationstring) / 2);
	setcursor(thcenter, vcenter);
	RED;
	printf("%s", detonationstring);
	Sleep(200);
	
	setcursor(thcenter, vcenter);
	LRED;
	printf("%s", detonationstring);
	Sleep(500);
	cls();
	
	
	fillwithcolor(BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE);
	Sleep(300);
	fillwithcolor(BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY);
	Sleep(300);
	fillwithcolor(BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE);
	Sleep(300);
	fillwithcolor(0);
	Sleep(2000);
	//	cursorshow();
	
	thcenter = hcenter - (strlen(missioncompletestring) / 2);
	setcursor(thcenter, vcenter);
	RED;
	printf("%s", missioncompletestring);
	Sleep(200);
	
	setcursor(thcenter, vcenter);
	LRED;
	printf("%s", missioncompletestring);
	Sleep(2000);
	cls();
}