Ejemplo n.º 1
0
void loadgame() {
	clrscr();
	printf("Loading\n");	
	int i,j;
 	for(i = 0;i < 10;i++) {
    		for(j = 0;j <= 100000000;j++);
    	printf(".");
	}    	
	printf("\nGame is loaded,press enter to play\n");	
	int snakeXY[2][MAX_SIZE];	
	int snakelength = 4;
	int dir = LEFT;
	int foodXY[0];
	int score = 0;
	int consolewidth = 80;
	int consoleheight = 25;
	int speed = getgamespeed();
	snakeXY[0][0] = 40;
	snakeXY[1][0] = 10;
	border(consolewidth, consoleheight);
	initsnake(snakeXY, snakelength);
	loadsnake(snakeXY,snakelength);	
	foodcreate(foodXY,consolewidth,consoleheight,snakeXY,snakelength);
	scoreboard(score,speed);
	startgame(snakeXY, foodXY, consolewidth, consoleheight, snakelength, dir, score, speed);
}
Ejemplo n.º 2
0
void gamestart()//游戏初始化

{

	system("mode con cols=100 lines=30");

	welcometogame();

	creatMap();

	initsnake();

	createfood();

}