void highscore()
{
	char title[]="HIGH SCORES";
	
	struct HighScore one_player=loadscore("oneplayer.scr");
	struct HighScore two_player=loadscore("twoplayer.scr");
	struct HighScore coop=loadscore("coop.scr");

	int length=0;
	while(title[length]!=0){length++;}

	fill_area(23, 7, 76, 42, char(0), background_colour);
	fill_area(1, 1, 78, 6, char(0), background_colour);
	print_font(title, 4+(screen_width/2)-(length/2)*4, 1, 12, 177);
//	print("Press any key to continue...", 25, 74, 12);
	
	displayscore(one_player, "One Player", 24, 8);
	displayscore(two_player, "Two Player", 50, 8);	
	displayscore(coop, "Co-op", 37,25);	
	
	while(!kbhit()){}
	fill_area(1, 1, 78, 6, char(0), background_colour);
}

struct HighScore loadscore(char name[])
{
	HighScore temp;
	ifstream scorein(name, ios::in|ios::binary);
	for(int i=0;i<10;i++)
	{
	scorein.getline(temp.info[i].name, 15, '~');
	scorein>>temp.info[i].lines;
	scorein>>temp.info[i].speed;
	}
	scorein.close();
	return temp;
}

void displayscore(struct HighScore temp, char name[], int x, int y)
{
	int x2=x+22;
	int y2=y+14;
	box(x, y, x2, y2, 12, 0, 2);

	print(name, x+2, y+2, 4);
	
	for(int i=0;i<10;i++)
	{
		print(temp.info[i].name, x+2, y+4+i, 4);
//		print("Ello!!!", x+2, y+4+i, 4);
		locate(x+14, y+4+i, 4, 4);
		cout<<temp.info[i].lines<<endl;
	}

}
