Пример #1
0
void mark_light()
{
	static time_t start,i=0;

	if(i==0)
	{
		time(&start);
		i=1;
	}
	time_t now;

	time(&now);

	static int anim[20];

	anim[now-start]++;

	if(now-start==1 ||now-start==2 || now-start==3 || now-start==4){	
			iShowBMP(100,250,"imagess//mark_1.bmp");
	}
	if(now-start==5||now-start==6|| now-start==7|| now-start==8){
			iShowBMP(100,250,"imagess//mark_2.bmp");
	}
	if(now-start==9||now-start==10|| now-start==11|| now-start==12){
			iShowBMP(100,250,"imagess//mark_3.bmp");

	}
	
}
void help_view(void)
{
	iShowBMP(100,100,"help_window.bmp");
	iShowBMP(985,100,"goback.bmp");


}
Пример #3
0
void milestone()
{

	iShowBMP(110,700-i,"imagess//win_track.bmp");

	if(i>700)
	{
		reach=0;
		win++;
	}

} 
void initial_Window(void)
{
	//creates the window to show
	if(mode==0){
		iSetColor(0,255,100);
		iFilledRectangle(0,0,window_sizeX,window_sizeY);
		iShowBMP(0,0,"func_plot.bmp");
		iShowBMP(700,400,"cartesian.bmp");
		iShowBMP(700,300,"polar.bmp");
		
		iShowBMP(400,200,"help.bmp");
		iShowBMP(250,200,"credit.bmp");
	}
	
	if(mode==1) cartesian_draw();
	else if(mode==2) polar_draw();

	else if(mode==4) help_view();
	else if(mode==5) show_credits();


}
Пример #5
0
void optionshow()
{
	iShowBMP(0,0,"imagess//LOAD4.bmp");


	if(flag7==2)
	{
			iShowBMP(0,0,"imagess//LOAD8.bmp");

			if(mposx>=1 && mposx<=120 && mposy>=90 && mposy<=201)
			{
			iShowBMP(0,0,"imagess//car_1.bmp");
			color_track=1;
			}

			if(mposx>=124 && mposx<=250 && mposy>=90 && mposy<=201)
			{
			iShowBMP(0,0,"imagess//car_2.bmp");
			color_track=2;
			}

			if(mposx>=255 && mposx<=380 && mposy>=90 && mposy<=201)
			{
			iShowBMP(0,0,"imagess//car_3.bmp");
			color_track=3;
			}

			if(mposx>=387 && mposx<=517 && mposy>=90 && mposy<=201)
			{
			iShowBMP(0,0,"imagess//car_4.bmp");
			color_track=4;
			}

			if(mposx>=521 && mposx<=648 && mposy>=90 && mposy<=201)
			{
			iShowBMP(0,0,"imagess//car_5.bmp");
			color_track=5;
			}
	}


}
Пример #6
0
void showhighscore()
{
	iShowBMP(0,0,"imagess\\SHOWHIGHSCORE.bmp");
	FILE *fp;
	fp=fopen("records\\highscore.txt","r+");

	if(!fp)
	{
		printf("ERROR");
		 
	}
	for(q=0;q<10;q++)
	{
		fscanf(fp,"%s %d",score[q].name,&score[q].level);
	}

	fclose(fp);

	for(q=0;q<10;q++)
	{
		sprintf(str,"%d.%s",q+1,score[q].name);
		iSetColor(255,255,255);
		iText(200,518-(q*41),str,GLUT_BITMAP_TIMES_ROMAN_24);

	
	}

	for(q=0;q<10;q++)
	{
		sprintf(str,"%d",score[q].level);
		iSetColor(255,255,255);
		iText(700,518-(q*41),str,GLUT_BITMAP_TIMES_ROMAN_24);

	
	}

}
Пример #7
0
void mycarmove_c()
{

	carsel1[8]=carselect+49;

	collision_report();

	freeze_player();

	if(collision_valid_1_c())
		collision_traff1_c();

	if(collision_valid_2_c())
		collision_traff2_c();

	chk_speed_c();

		if(move_c1==0 && move_c2==0 && move_up_c==0 && move_down_c==0 && count_c==0)
			iShowBMP(j_c,0,carsel1);
		else
		{
		if(move_c1==1 && j_c<road_lim_right_c)
		{
			j_c++;
			temp_c=j_c;
		}
		if(move_c2==1 && j_c>road_lim_left_c)
		{
			j_c--;
			temp_c=j_c;
		}
		if(move_up_c==1 && y_c<sky_lim_c)
		{
			y_c++;
			temp_y_c=y_c;
		}
		else if(self_drift_c && y_c>=sky_lim_2_c)
		{
			y_c--;
			temp_y_c=y_c;
		}
		if(move_down_c==1 && y_c>=sky_lim_2_c)
		{
			y_c--;
			temp_y_c=y_c;
		}
		if(move_c1==1 || move_c2==1)
		{
			x_cord_c=j_c;
			y_cord_c=temp_y_c;
		}
		else if(move_up_c==1 || move_down_c==1)
		{
			x_cord_c=temp_c;
			y_cord_c=y_c;
		}
		else if(move_c1==0 && move_c2==0 && move_up_c==0 && move_down_c==0 &&count_c==1)
		{
			x_cord_c=temp_c;
			y_cord_c=temp_y_c;
		}

		iShowBMP(x_cord_c,y_cord_c,carsel1);
		}
	

}
Пример #8
0
void mycarmove()
{
	
	carsel[8]=carselect+48;
	
	collision_report();

	freeze_player();

	if(collision_valid_1())
		collision_traff1();

	if(collision_valid_2())
		collision_traff2();


	chk_speed();
	

		if(move1==0 && move2==0 && move_up==0 && move_down==0 && count==0)
			iShowBMP(j,0,carsel);
		else
		{
		if(move1==1 && j<road_lim_right)
		{
			j++;
			temp=j;
		}

		if(move2==1 && j>road_lim_left)
		{
			j--;
			temp=j;
		}

		if(move_up==1 && y<=sky_lim)
		{
			y++;
			temp_y=y;
		}
		else if(self_drift && y>=sky_lim_2)
		{
			y--;
			temp_y=y;
		}

		if(move_down==1 && y>=sky_lim_2)
		{
			y--;
			temp_y=y;
		}

		if(move1==1 || move2==1)
		{
			x_cord=j;
			y_cord=temp_y;
		}
		else if(move_up==1 || move_down==1)
		{
			x_cord=temp;
			y_cord=y;
		}
		else if(move1==0 && move2==0 && move_up==0 && move_down==0 && count==1)
		{
			x_cord=temp;
			y_cord=temp_y;
		}

		iShowBMP(x_cord,y_cord,carsel);
		}

	
}
void cartesian_draw()
{
	int i,mx,my,arrayi,count,fxpos,func_serial,lekhay=405;
	double p1,p2,p3,p4;
	int axisi=1;
	int yaxisy,xaxisx,temp2;
	char buffer[10];
	iSetColor(0,0,255);

	iShowBMP(670,0,"rene_descartes.bmp");
	iSetColor(0,0,0);
	iFilledRectangle(0,0,670,700);
	iSetColor(100,100,100);
	iFilledRectangle(51,window_sizeY-620,600,600);
	iSetColor(255,255,255);
	iFilledRectangle(54,window_sizeY-617,594,594);
	iShowBMP(730,450,"func_input.bmp");
	iShowBMP(1000,100,"goback.bmp");
	iShowBMP(900,100,"reset.bmp");
	if(zoomflag<4){
		iShowBMP(823,609,"zoom_in.bmp");
	}
	if(zoomflag>0){
		iShowBMP(873,609,"zoom_out.bmp");
	}
	fxpos=399;
	if(current<3){
		iShowBMP(1040,newy1,"new.bmp");
	}
	if(current>1){
		iShowBMP(1080,newy1,"delete.bmp");
	}
	if(current<3||current>1){
		iShowBMP(1120,newy1,"save.bmp");
		iShowBMP(1080,newy1-35,"load.bmp");
	}
	for(func_serial=1;func_serial<=current;++func_serial)
		{
			iShowBMP(700,fxpos,"y=f(x).bmp");
			iSetColor(204,255,153);
			iFilledRectangle(735,fxpos+1,300,30);
			fxpos-=100;
		}
	iSetColor(230,230,250);
	count=0;
	for(i=-3;(594-i)>0;i=i+10)
	{
		if(count%10==0) iSetColor(105,105,105);
		iRectangle(54+i,window_sizeY-617,594-i,594);
		count++;
		iSetColor(230,230,250);
	}
	iSetColor(230,230,250);
	count=0;
	for(i=-3;(594-i)>0;i=i+10)
	{
		if(count%10==0) iSetColor(205,133,63);
		iRectangle(54,window_sizeY-617+i,594,594-i);
		count++;
		iSetColor(230,230,250);
	}
	iSetColor(72,61,139);
	mx=(54+594+55)/2;
	my=(window_sizeY-617+594+82)/2;
	alpha = mx;
	beta = my;
	iFilledRectangle(mx,window_sizeY-617,2,594);
	iFilledRectangle(54,my,594,2);
	iSetColor(255,255,255);
	iFilledRectangle(50,window_sizeY-640,601,20);
	iFilledRectangle(12,window_sizeY-618,38,600);
	iSetColor(0,0,0);
	iRectangle(50,window_sizeY-640,601,22);
	iRectangle(12,window_sizeY-618,38,600);
	for(func_serial=1;func_serial<=current;++func_serial){
		iText(750,lekhay,primary[func_serial],GLUT_BITMAP_TIMES_ROMAN_24);
		lekhay=lekhay-100;
	}
	yaxisy=673;
	for(axisi=0;axisi<7;++axisi){
		temp2=axis[axisi]*axisvalue;
		itoa(temp2,buffer,10);
		
		if(zoomflag==4 && (axisi==0 || axisi==6 || axisi==2 || axisi==4)){
			if(axisi==0){
				iText(18,yaxisy,"7.5");
			}
			else if(axisi==6){
				iText(18,yaxisy,"-7.5");
			}
			else if(axisi==4){
				iText(18,yaxisy,"-2.5");
			}
			else if(axisi==2){
				iText(18,yaxisy,"2.5");
			}
		}
		else{
			iText(18,yaxisy,buffer);
		}
		yaxisy=yaxisy-98;

	}
	xaxisx=53;
	for(axisi=6;axisi>=0;--axisi){
		temp2=axis[axisi]*axisvalue;
		itoa(temp2,buffer,10);
		
		if(zoomflag==4 && (axisi==0 || axisi==6 || axisi==2 || axisi==4)){
			if(axisi==0){
				iText(xaxisx,70,"7.5");
			}
			else if(axisi==6){
				iText(xaxisx,70,"-7.5");
			}
			else if(axisi==4){
				iText(xaxisx,70,"-2.5");
			}
			else if(axisi==2){
				iText(xaxisx,70,"2.5");
			}
		}
		else{
			iText(xaxisx,70,buffer);
		}
		xaxisx=xaxisx+98;

	}
	iText(54,360,"X' ",GLUT_BITMAP_TIMES_ROMAN_24);
	iText(625,360,"X ",GLUT_BITMAP_TIMES_ROMAN_24);
	iText(330,360,"O ",GLUT_BITMAP_TIMES_ROMAN_24);
	iText(330,656,"Y ",GLUT_BITMAP_TIMES_ROMAN_24);
	iText(328,85,"Y' ",GLUT_BITMAP_TIMES_ROMAN_24);


	if(calcuflag){
		calculate();
		calculated=current;
	}
		for(func_serial=1;func_serial<=calculated;++func_serial){
		for(arrayi=1;arrayi<=totalarray;++arrayi){
			finalx[func_serial][arrayi]=xvalue[func_serial][arrayi]*(zoom)+alpha;
			finaly[func_serial][arrayi]=yvalue[func_serial][arrayi]*(zoom)+beta;
		}
		for(arrayi=1;arrayi<totalarray;++arrayi){
			p1=finalx[func_serial][arrayi];
			p2=finaly[func_serial][arrayi];
			p3=finalx[func_serial][arrayi+1];
			p4=finaly[func_serial][arrayi+1];
			if(mapvalue[func_serial][arrayi]==0 && mapvalue[func_serial][arrayi+1]==0 && pointcheck(p1,p2,p3,p4)){
				if(func_serial==1) iSetColor(0,100,0);
				else if(func_serial==2) iSetColor(255,0,0);
				else if(func_serial==3) iSetColor(25,25,112);
				iLine(p1,p2,p3,p4);
			}
		}

		}
			
	if(func_save==1||func_save==2||func_save==3)
		//iText(300,200,primary[func_save]);
		save_points(func_save);
	if(func_load==1||func_load==2||func_load==3){
		load_function(func_load);
		calcuflag=1;
		calculated=func_load;
		func_load=0;
		primlength=1;
	}


}
Пример #10
0
void declare_win()
{
	if(y>y_c)
	{
		switch(color_track)
		{
		 case 1:
		 iShowBMP(0,0,"imagess//pliss_0.bmp");break;
		 case 2:
		 iShowBMP(0,0,"imagess//pliss_1.bmp");break;
		 case 3:
		 iShowBMP(0,0,"imagess//pliss_2.bmp");break;
		 case 4:
		 iShowBMP(0,0,"imagess//pliss_3.bmp");break;
		 case 5:
		 iShowBMP(0,0,"imagess//pliss_4.bmp");break;

		 default:
			iShowBMP(0,0,"imagess//pliss_0.bmp");break;
		}


		   
		 
	}

	if(y_c>y)
	{
		switch(color_track)
		{
		 case 5:
		 iShowBMP(0,0,"imagess//pliss_5.bmp");break;
		 case 1:
		 iShowBMP(0,0,"imagess//pliss_1.bmp");break;
		 case 2:
		 iShowBMP(0,0,"imagess//pliss_2.bmp");break;
		 case 3:
		 iShowBMP(0,0,"imagess//pliss_3.bmp");break;
		 case 4:
		 iShowBMP(0,0,"imagess//pliss_4.bmp");break;

		 default:
			iShowBMP(0,0,"imagess//pliss_1.bmp");break;
		}
		  
		   
		
	}

	if(y_c==y)
	{
		iShowBMP(0,0,"imagess//pliss_draw.bmp");
		  
	    draw=1;
	}

}
Пример #11
0
void iDraw()
{
	iClear();

	switch(flag)
	{
		
		case 0:frontpage();
				break;

		case 1:if(win!=1 && timec!=1 && end==0)
			   {
					roadsidedraw();
					roaddraw();
					roadlinedraw();
					roadlinedraw_c();
					mycarmove();
					mycarmove_c();
					traffic_rand();
					winshow();

					
					if(flag14<=3)
					{
						mark_delay();
						track_col();
						mark_light();
					}
					else 
					{
						cardamage();
						showrace();
						kilometershow();
						timeshow();
					}
		
				}

			if(collision==1500||busted==1||timec==1)
			{
				check_high();
	
			}
			
			if(mark==1){
				iShowBMP(0,0,"imagess//LOAD1.bmp");
		
			 
				mark=0;
			}
			//if(flag8==2)
			//	reinitialize();
		/*	if(flag2==1&&busted==0)
			{
				call_police();
			
			}*/
	
			break;

		case 2:optionshow();
				   break;
		case 3:showhighscore();
				   break;
		case 4:helppage();
				   break;
		case 5:showcredit();
				   break;
		case 6:exit(0);
				   break;
		
		case 8:loadgame();
				   break;
	}
}
Пример #12
0
void traffic_rand()
{
	if(random==1)
	{
		co_x=rand()%650;
		
		if(co_x>300 && co_x<=400)co_x+=10;
		if(co_x>200 && co_x<=300)co_x+=100;
		if(co_x>100 && co_x<=200)co_x+=200;
		if(co_x>0 && co_x<=100)co_x+=300;

		random=0;
	}

	if(random3==1)
	{
		co_x2=rand()%650;
		
		if(co_x2>300&&co_x2<=400)co_x2+=10;
		if(co_x2>200&&co_x2<=300)co_x2+=100;
		if(co_x2>100&&co_x2<=200)co_x2+=200;
		if(co_x2>0&&co_x2<=100)co_x2+=300;

		if((co_x2+72>=co_x)&&(co_x2<co_x))co_x2-=100;
		if((co_x2+72>=co_x)&&(co_x2<=co_x+72))co_x2+=100;

		random3=0;
	
	}

	if(speed_limit2>=1580)
	{
		random3=1;
		random4=1;
	
	}
	
	if(speed_limit>=2480)
	{
		random=1;
		random2=1;
	}
	
	if(random4==1)
	{
		carchoice2=rand()%2;
		random4=0;
	}

	if(random2==1)
	{
		carchoice=rand()%2;
		random2=0;
	
	}

	if(mode1==1)
	{
		anothercarspeed2();
	
	}

	if(mode1==0)
	{
		speed2+=.0005;
		if(speed2>=1.5)speed2=1.5;
	
	}

	if(mode1==1)
	{
		anothercarspeed();
		
	}
	if(mode1==0)
	{
		speed+=.0002;
		if(speed>=1.2)speed=1.2;
	
	}

	if(mode1==1) speed_limit+=speed;

	if(mode1==0) speed_limit-=speed;

	if(mode1==1)speed_limit2+=speed2;

	if(mode1==0)speed_limit2-=speed2;
		
	if(speed_limit>=2500) speed_limit=5;


	if(speed_limit2>=1680) speed_limit2=5;
	
	if(carchoice==0)
	{

		car1_x=co_x;
		car1_y=co_y-speed_limit;

		iShowBMP(car1_x,car1_y,"imagess//5.bmp");
	

	}
	else
	{
		car1_x=co_x;
		car1_y=co_y-speed_limit;

		iShowBMP(car1_x,car1_y,"imagess//6.bmp");
	}


	if(carchoice2==0)
	{
		car1_x2=co_x2;
		car1_y2=co_y2-speed_limit2;

		iShowBMP(car1_x2,car1_y2,"imagess//2.bmp");
	}
	else
	{
		car1_x2=co_x2;
		car1_y2=co_y2-speed_limit2;

		iShowBMP(car1_x2,car1_y2,"imagess//4.bmp");
	}

}
Пример #13
0
void helppage()
{
	iShowBMP(0,0,"imagess/SHOWHELP1.bmp");

}
Пример #14
0
void showcredit()
{
	iShowBMP(0,0,"imagess\\SHOWCREDIT.bmp");
}
void show_credits(void)
{
	iShowBMP(100,100,"credits.bmp");
	iShowBMP(985,100,"goback.bmp");
}
Пример #16
0
void winshow()
{
	if(damagecount==100 && win!=1 && timec!=1)
	{
		switch(color_track){

		case 1:
		 iShowBMP(0,0,"imagess//pliss_0_dam.bmp");break;
		 case 2:
		 iShowBMP(0,0,"imagess//pliss_1_dam.bmp");break;
		 case 3:
		 iShowBMP(0,0,"imagess//pliss_2_dam.bmp");break;
		 case 4:
		 iShowBMP(0,0,"imagess//pliss_3_dam.bmp");break;
		 case 5:
		 iShowBMP(0,0,"imagess//pliss_4_dam.bmp");break;

		 default:
		 iShowBMP(0,0,"imagess//pliss_0_dam.bmp");break;
		}
		 
		 

	}
  if(damagecount_c==100&& win!=1 && timec!=1)
	{
		switch(color_track){

		case 5:
		 iShowBMP(0,0,"imagess//pliss_5_dam.bmp");break;
		 case 1:
		 iShowBMP(0,0,"imagess//pliss_1_dam.bmp");break;
		 case 2:
		 iShowBMP(0,0,"imagess//pliss_2_dam.bmp");break;
		 case 3:
		 iShowBMP(0,0,"imagess//pliss_3_dam.bmp");break;
		 case 4:
		 iShowBMP(0,0,"imagess//pliss_4_dam.bmp");break;

		 default:
		 iShowBMP(0,0,"imagess//pliss_1_dam.bmp");break;
		}
		 
		 


	}

	if(damagecount==100&&damagecount_c==100 && win!=1 && timec!=1)
	{
		
		iShowBMP(0,0,"imagess//LOAD1.bmp");
		  
		 
	}
		

	if(win==1 && timec!=1)
	{
		declare_win();
	}

	if(timec==1 && win!=1 )
	{
		iShowBMP(0,0,"imagess//pliss_time.bmp");
		  
		 
	}


	if(damagecount==100||damagecount_c==100|| win==1 || timec==1 && asif || draw==1)
	{

		iShowBMP(0,0,"imagess//SHOWHIGHSCORE.bmp");
		win=0;
		timec=0;
		collision=0;
		collision_c=0;
		reinitialize();
		mark=1;
		//flag=0;
		//exit(1);
	}




}
Пример #17
0
void frontpage()
{
	
	
	switch(flag1)
	{
	case 1:
		
			iShowBMP(0,0,"imagess\\NEW GAME.2.bmp");
			if(playsound1==0)
			{
				//PlaySound("soundss//7.wav", NULL, SND_ASYNC);
				playsound1=1;
			}
	
		
		break;



	case 2:
	
		iShowBMP(0,0,"imagess\\OPTION.2.bmp");
		if(playsound1==0)
		{
			//PlaySound("soundss//7.wav", NULL, SND_ASYNC);
			playsound1=1;
		}
	
	
	break;



	case 3:
	
		iShowBMP(0,0,"imagess\\HIGH SCORE.2.bmp");
		if(playsound1==0)
		{
			//PlaySound("soundss//7.wav", NULL, SND_ASYNC);
			playsound1=1;
		}
	
	
	break;



	case 4:
	
		iShowBMP(0,0,"imagess\\HELP.2.bmp");
		if(playsound1==0)
		{
			//PlaySound("soundss//7.wav", NULL, SND_ASYNC);
			playsound1=1;
		}
	
	
	break;



	case 5:
	
		iShowBMP(0,0,"imagess\\CREDIT.2.bmp");
		if(playsound1==0)
		{
			//PlaySound("soundss//7.wav", NULL, SND_ASYNC);
			playsound1=1;
		}
	
	
	break;



	case 6:
	
		iShowBMP(0,0,"imagess\\QUIT.2.bmp");
		if(playsound1==0)
		{
			//PlaySound("soundss//7.wav", NULL, SND_ASYNC);
			playsound1=1;
		}
	
	
	break;

	default:
		iShowBMP(0,0,"imagess/MYFRONTPAGE.bmp");
		playsound1=0;
	}
	

}
Пример #18
0
void roadlinedraw_c()
{

	double x1_c=700,y1_c=750;

	if(x2_c>=3.5+addition)
		x2_c=3.5+addition;

	if(x2_c<=0)
		x2_c=0;

	if(mode1_c==1)
	{
		x2_c+=.0095;	
	}
	if(mode2_c==1||mode1_c==0)
	{
		if(mode1_c==0 && mode2_c!=1)
		{
			x2_c-=.0009;
		}
		if(mode2_c==1) x2_c-=.003;
	}

	iSetColor(255,215,0);
	iFilledRectangle(x1_c,y1_c-i,15,100);

	if(i<=210&&i>=200)h=5;
	{
		iFilledRectangle(x1_c,y1_c-h,15,100);
		if(colicheck==0)h+=x2_c;
		else h+=.8;
		
	}
	if(i<=410 && i>=400)z=5;
	{
		iFilledRectangle(x1_c,y1_c-z,15,100);
		if(colicheck==0)z+=x2_c;
		else z+=.8;

	
	}
	if(i<=610&&i>=600)g=5;
	{
		iFilledRectangle(x1_c,y1_c-g,15,100);
		if(colicheck==0)g+=x2_c;
		else g+=.8;
		

	
	}

	if(colicheck==0)i+=x2_c;
	else 
			
	{
		i+=.8;
		x2_c=.8;
	}
	
	if(i>=850)
	{
		i=0;
		reach++;
	}
	if(reach==15)
	{
		iShowBMP(x1_c+100,y1_c+100-i,"imagess//0_norm.bmp");
	}
	if(reach==16)
	{
		iShowBMP(x1_c+100,y1_c+100-i,"imagess//1_norm.bmp"); 
	}
	if(reach==25)
	{
		iShowBMP(x1_c+100,y1_c+100-i,"imagess//2_norm.bmp"); 
	}
	if(reach==26)
	{
		iShowBMP(x1_c+100,y1_c+100-i,"imagess//3_norm.bmp"); 
	}
	
	if(reach>=30)
	{
		milestone();
		declare_win();
		iText(500,350,"GAME OVER");
	
	}

	
}
Пример #19
0
void roadlinedraw()
{

	int x1=300,y1=750;

	if(x2>=3.5+addition)x2=3.5+addition;
	if(x2<=0)x2=0;
	if(mode1==1)
	{
		x2+=.0095;
		asif++;
	}

	if(mode2==1||mode1==0)
	{
		if(mode1==0 && mode2!=1)
		{
			x2-=.0009;
		}
		if(mode2==1) x2-=.003;
	}


	iSetColor(255,215,0);

	iFilledRectangle(x1,y1-i,15,100);

	if(i<=210&&i>=200)h=5;
	{
		iFilledRectangle(x1,y1-h,15,100);
		if(colicheck==0)h+=x2;
		else h+=.8;
		
	}
	if(i<=410 && i>=400)z=5;
	{
		iFilledRectangle(x1,y1-z,15,100);
		if(colicheck==0)z+=x2;
		else z+=.8;

	
	}
	if(i<=610&&i>=600)g=5;
	{
		iFilledRectangle(x1,y1-g,15,100);
		if(colicheck==0)g+=x2;
		else g+=.8;
		
	}

	if(colicheck==0)i+=x2;
	else 
			
	{
		i+=.8;
		x2=.8;
	}
	
	if(i>=850)
	{
		i=0;
		reach++;
	}

	if(reach==10)
	{
		iShowBMP(x1-180,y1+100-i,"imagess//4_norm.bmp"); 
	}
	if(reach==11)
	{
		iShowBMP(x1-180,y1+100-i,"imagess//5_norm.bmp"); 
	}
	if(reach==20)
	{
		iShowBMP(x1-180,y1+100-i,"imagess//6_norm.bmp"); 
	}
	if(reach==21)
	{
		iShowBMP(x1-180,y1+100-i,"imagess//2_norm.bmp");
	}

	if(reach>=30)
	{
		milestone();//for adding milestone 
	
	}
	
}
void polar_draw()
{
	int i,fxpos,mx,my,func_serial,arrayi;
	int lekhay=405;
	int axisi=1;
	int xaxisx,temp2;
	char buffer[10];
	double p1,p2,p3,p4;
	iSetColor(0,0,255);
	iShowBMP(0,0,"hipparchus.bmp");
	iSetColor(0,0,0);
	iFilledRectangle(0,0,670,700);
	iSetColor(100,100,100);
	iFilledRectangle(51,window_sizeY-620,600,600);
	iSetColor(255,255,255);
	iFilledRectangle(54,window_sizeY-617,594,594);
	iSetColor(0,0,255);
	iSetColor(0,0,0);
	iSetColor(112,128,144);
	mx=(54+594+53)/2;
	my=(window_sizeY-617+594+81)/2;
	alpha = mx;
	beta = my;
	iFilledRectangle(alpha,window_sizeY-617,2,594);
	iFilledRectangle(54,beta,594,2);
	iSetColor(176,196,222);
	for(i=0;i<=540;i=i+60)
	{
		if(i<=300)
			iCircle(alpha,beta,i);
	}
	iShowBMP(730,450,"func_input.bmp");
	iShowBMP(1000,100,"goback.bmp");
	iShowBMP(900,100,"reset.bmp");
	if(zoomflag<4){
		iShowBMP(823,609,"zoom_in.bmp");
	}
	if(zoomflag>0){
		iShowBMP(873,609,"zoom_out.bmp");
	}
	fxpos=399;
	if(current<3){
		iShowBMP(1040,newy1,"new.bmp");
	}
	if(current>1){
		iShowBMP(1080,newy1,"delete.bmp");
	}
	if(current<3||current>1){
		iShowBMP(1120,newy1,"save.bmp");
		iShowBMP(1080,newy1-35,"load.bmp");
	}
	for(func_serial=1;func_serial<=current;++func_serial)
		{
			iShowBMP(700,fxpos,"r=f(D).bmp");
			iFilledRectangle(735,fxpos+1,300,30);
			fxpos-=100;
		}
	iSetColor(0,0,0);
	for(func_serial=1;func_serial<=current;++func_serial){
		iText(750,lekhay,primary[func_serial],GLUT_BITMAP_TIMES_ROMAN_24);
		lekhay=lekhay-100;
	}
	xaxisx=alpha-10;
	for(axisi=0;axisi<6;++axisi){
		temp2=polar[axisi]*axisvalue;
		itoa(temp2,buffer,10);
		
		if(zoomflag==4 && (axisi==1 || axisi==3 || axisi==5)){
			if(axisi==1)iText(xaxisx,beta-8,"1.5");
			else if(axisi==3)iText(xaxisx,beta-8,"4.5");
			else if(axisi==5)iText(xaxisx,beta-8,"7.5");
		}
		else{
			iText(xaxisx,beta-8,buffer);
		}
		xaxisx=xaxisx+56;

	}
	if(calcuflag){
		calculate();
		calculated=current;
	}
		for(func_serial=1;func_serial<=calculated;++func_serial){
		for(arrayi=1;arrayi<=totalarray;++arrayi){
			finalx[func_serial][arrayi]=xvalue[func_serial][arrayi]*(zoom)+alpha;
			finaly[func_serial][arrayi]=yvalue[func_serial][arrayi]*(zoom)+beta;
		}
		for(arrayi=1;arrayi<totalarray;++arrayi){
			p1=finalx[func_serial][arrayi];
			p2=finaly[func_serial][arrayi];
			p3=finalx[func_serial][arrayi+1];
			p4=finaly[func_serial][arrayi+1];
			if(mapvalue[func_serial][arrayi]==0 && mapvalue[func_serial][arrayi+1]==0 && pointcheck(p1,p2,p3,p4)){
				if(func_serial==1) iSetColor(0,100,0);
				else if(func_serial==2) iSetColor(255,0,0);
				else if(func_serial==3) iSetColor(25,25,112);
				iLine(p1,p2,p3,p4);
			}
			

		}

		}

		if(func_save==1||func_save==2||func_save==3)
		save_points(func_save);
	if(func_load==1||func_load==2||func_load==3){
		load_function(func_load);
		calcuflag=1;
		calculated=func_load;
		func_load=0;
		primlength=1;
	}

}