Пример #1
0
newgame()
{
	if (Newgame <= 0) {
		instruct();
		Game = 0;
	/*	while(Getc()!=-1) ; /* flush keyboard queue */
		while (Game==0 && Running) kbpoll();
	} else
		Game = Newgame;
	if ( !Running )
		return;
	black();

	switch ( Game ) {
	case 1:
		Seekprob = 40;
		Seekinc = 10;
		Monbase = 40;
		Pacman.time = 43;
		break;
	case 2:
		Seekprob = 80;
		Seekinc = 2;
		Monbase = 30;
		Pacman.time = 35;
		break;
	case 3:
		Seekprob = 100;
		Seekinc = 0;
		Monbase = MINMONTIME;
		Pacman.time = MINPACTIME;
		break;
	case 4:
		Seekprob = 90;
		Seekinc = 0;
		Monbase = 0;
		Pacman.time = 0;
	}
	Newgame = 0;
	Pacman.alive = TRUE;
	Wave = 0;
	Score = 0;
	Nextbonus = SCOREMOD;
	settextop(REPLACE);
	mvprintf(SCOREROW,1,"S C O R E : ");
	addscore(0);
	addscore(FLUSHSCORE);
#ifdef HIGHSCORE
	if ( Highscore[Game-1] != NOSCORE )
		mvprintf(SCOREROW,HIGHCOL,"H I G H   S C O R E : %D",(long)Highscore[Game-1]);
#endif
	Pacmen = 1;
	mvprintf(WAVEROW,WAVECOL,"W A V E : ");
	addmen(PACMEN-1);
	pacnew();
	monnew();
}
Пример #2
0
int mprintf(const char* format, ...)
{
	va_list args;
	va_start(args, format);
	int ret = mvprintf(format, args);
	va_end(args);
	return ret;
}
Пример #3
0
newwave()
{
	register monster *mptr;
	addscore(FLUSHSCORE);
	Wave++;
	mvprintf(WAVEROW,WAVECOL+10,"%D",Wave);
	if ( Wave&1 ) {
		for ( mptr=Monster ; mptr < &Monster[MAXMONSTER] ; mptr++ )
			if ( mptr->time > MINMONTIME )
				mptr->time = max(mptr->time-MONDELTA,MINMONTIME);
		if ( Pacman.time > MINPACTIME )
			Pacman.time = max(Pacman.time-PACDELTA,MINPACTIME);
	}
	newboard();
	drawboard();
	Dotsrem = DOTS;
	Seekprob += Seekinc;
	elinit();
	pacinit();
	moninit();
	fruitinit(TRUE);
}
Пример #4
0
Файл: log.c Проект: eswartz/emul
static void
vlprintf(const char *format, va_list va)
{
	char appbuf[256], *append;
	int         applen;
	char *ptr;

	// append may or may not be appbuf
	append = mvprintf(appbuf, sizeof(appbuf),
					  format, va);
	if (!append)
		exit(1);

	applen = strlen(append);

	// strbufptr may not have enough space to append this,
	// or it may have already been allocated from this heap:
	// if so, get memory for the new string and construct it

	if (strbufptr != strbuf || applen + strbufidx >= sizeof(strbuf)) {
		ptr = (char *)xmalloc(applen + strbufidx + 1);

		memcpy(ptr, strbufptr, strbufidx);
		memcpy(ptr + strbufidx, append, applen + 1);

		if (strbufptr != strbuf)
			xfree(strbufptr);
		strbufptr = ptr;
		strbufidx += applen;

		if (append != appbuf)
			xfree(append);
	} else {
		memcpy(strbufptr + strbufidx, append, applen + 1);
		strbufidx += applen;
	}
}
Пример #5
0
/*
 * Display Game instructions
 */
instruct()
{
	int i;

	black();
	settextop(REPLACE);
	mvprintf(11,1,"P A C M A N");
	mvprintf(13,10,"<h> or <keypad-4> to move left.");
	mvprintf(14,10,"<j> or <keypad-2> to move down.");
	mvprintf(15,10,"<k> or <keypad-8> to move up.");
	mvprintf(16,10,"<l> or <keypad-6> to move right.");
	mvprintf(17,10,"< > to stop.");

	mvprintf(19,10,"<q> to quit.");
	mvprintf(20,10,"<n> to start a new game.");
	mvprintf(21,10,"<s> to toggle sound.");
	mvprintf(23,10,"Select game 1, 2, 3, or 4");
#ifdef BILL
	if(BillMode)
		printf(".");
#else
	printf(".");
#endif
	mvprintf(26, 10, "GAME    HIGH SCORE    WAVE");
	for(i=0;i<MAXGAMES;i++)
		mvprintf(27+i, 10, "%3d      %7d      %3d", i+1, Highscore[i], MaxWave[i]);
	if(Lastscore>=0)
		mvprintf(27+i+1, 10, "Last Score: %d", Lastscore);
	return;
}