void strategySelect()
{
	printf("Press A for luggage carts\n"); //Strategy 1
	printf("Press B for tower tip\n"); //Strategy 2
	printf("Press <- for biofuel block\n"); //Strategy 3
	printf("Press -> for center defense\n"); //Strategy 4
	while (black_button() == 0)
	{
		if (a_button() == 1)
		{
			printf("You picked luggage carts\n");
			printf("Press black button to confirm\n");
			strategy = 1;
		}
		if (b_button() == 1)
		{
			printf("You picked tower tip\n");
			printf("Press black button to confirm\n");
			strategy = 2;
		}
		if (left_button() == 1)
		{
			printf("You picked biofuel block\n");
			printf("Press black button to confirm\n");
			strategy = 3;
		}
		if (right_button() == 1)
		{
			printf("You picked center defense\n");
			printf("Press black button to confirm\n");
			strategy = 4;
		}
	}
}
int main()
{
    X=0;
    create_connect();
    set_create_total_angle(0);
    printf("X\tAngle");
    while(black_button()==0)
    {
        if (a_button()==1)
        {
            turnHalfCCW();
            printf("%d\t%d\n",X,get_create_total_angle(0.1));
        }
        if (b_button()==1)
        {
            turnHalfCW();
            printf("%d\t%d\n",X,get_create_total_angle(0.1));
        }
        if (left_button()==1)
        {
            TurnCCW();
            printf("%d\t%d\n",X,get_create_total_angle(0.1));
        }
        if (right_button() == 1)
        {
            TurnCW();
            printf("%d\t%d\n",X,get_create_total_angle(0.1));
        }
    }
}
Example #3
0
void	pre_interface(t_bunny_pixelarray *pix)
{
  background_set(pix);
  left_button(pix);
  right_button(pix);
  player_tab_background(pix);
  player_tab_lines(pix);
  textbar_set(pix);
  chatbox_set(pix);
}
Example #4
0
void light_it_up(int light_port)
{
	int l_on_, l_off_, l_mid_, OK=0;
	float s;

	while (!OK) {
		cbc_display_clear();
		cbc_printf (0,0,"CALIBRATE: sensor port #%d", light_port);

		cbc_printf(0,1,"  press <-- when light on");
		while(!left_button()){/*sensor value when light is on*/
			cbc_printf(0,2,"  value is %d, bright = low   ",l_on_=analog10 (light_port));
			msleep(50);
		}

		cbc_printf(0,1,"  light on value is = %d        ", l_on_);
		sleep(1.);

		cbc_printf(0,2,"  press --> when light off             ");
		while(!right_button()){	/*sensor value when light is off*/
			cbc_printf(0,3,"   value is %d, dark = high   ",l_off_=analog10 (light_port));
			msleep(50);
		}

		cbc_printf(0,2,"  light off value is = %d         ", l_off_);
		sleep(1.);

		cbc_printf(0,3,"                              ");

		if((l_off_-l_on_)>=120){ /*bright = small values */
			OK=1;
			l_mid_=(l_on_+l_off_)/2;
			cbc_printf(0,4,"Good Calibration!");
			cbc_printf(0,6,"Diff = %d:  WAITING",l_off_-l_on_);
			while(analog10(light_port)>l_mid_){
				cbc_printf(0,7,"Value = %d; Threshold = %d   ",analog10(light_port),l_mid_);
				msleep(25);
			}
			cbc_printf(0,6,"Going!                      ");
			cbc_printf(0,7,"Value = %d; Threshold = %d   ",analog10(light_port),l_mid_);
		}
		else{
			s=seconds();
			cbc_printf(0,6,"BAD CALIBRATION");
			if(l_off_<512){
				cbc_printf(0,7,"   Add Shielding!!");
			}
			else{
				cbc_printf(0,7,"   Aim sensor!!");
			}
		}
	}
}
Example #5
0
void wait_for_light(int light_port_)
{
	int l_on_, l_off_, l_mid_, t, good=0;
	
	/* print statements may look funny but are spaced for LCD*/
	while(!good){
		printf ("Cal. with sensoron port #%d\n", light_port_);
		sleep(2.);
		
		printf("Cal: press Left when light on\n");
		while(!left_button());
		l_on_=analog(light_port_); /*sensor value when light is on*/
		beep();
		
		printf("Cal: light on   value is=%d\n", l_on_);
		sleep(1.);
		beep();
		
		printf("Cal: press Right when light off\n");
		while(!right_button());
		l_off_=analog(light_port_); /*sensor value when light is off*/
		beep();
		
		printf("Cal: light off  value is=%d\n", l_off_);
		sleep(1.);
		beep();
		
		if((l_off_-l_on_)>=15){ /*bright = small values */
			l_mid_=(l_on_+l_off_)/2;
			printf("Good CalibrationDiff=%d Waiting\n",(l_off_-l_on_));
			good=1;
			while(analog(light_port_)>l_mid_) 
			tone(440.,100);
		}
		else{
			if(l_off_<128){
				printf("Bad Calibration Add Shielding!!\n");
				for(t=100; t<10000; t=t+200) tone((float)t,50);
			}
			else{
				printf("Bad Calibration Aim sensor!!\n");
				for(t=10000; t>200; t=t-200) tone((float)t,50);
			}
		}
	}
}
Example #6
0
int main()
{
	X=0;
	create_connect();
	set_create_total_angle(0);
	printf("X\tAngle");
	cbc_display_clear();
		printf("A to turn CCW 90deg.\tB to turn CW 90deg.\n");
		printf("Left to turn CCW 45deg.\tRight to turn CW 45deg.\n");
		printf("Down to force angle readjustment.\n");
	while(black_button()==0)
	{
		if (a_button()==1)
		{
			turn(tspeed,45);
			//turnHalfCCW();
			printf("%d\t%d\n",X,get_create_total_angle(0.1));
		}
		if (b_button()==1)
		{
			turn(tspeed,-45);
			//turnHalfCW();
			printf("%d\t%d\n",X,get_create_total_angle(0.1));
		}
		if (left_button()==1)
		{
			turn(tspeed,90);
			//turnCCW();
			printf("%d\t%d\n",X,get_create_total_angle(0.1));
		}
		if (right_button() == 1)
		{
			turn(tspeed,-90);
			//turnCW();
			printf("%d\t%d\n",X,get_create_total_angle(0.1));
		}
		if (down_button() == 1)
		{
			turnAdjust();
			printf("%d\t%d\n",X,get_create_total_angle(0.1));
		}
	}
}
Example #7
0
void main(){
	int X = 0;
	create_connect();
	set_create_distance(0);
	set_create_total_angle(0);
	enable_servos();
	armPosBlockStack1();
	clawStack1();
/*	create_drive(-500,-380);
	sleep(2.3);
	create_stop();
}
*/  
//	writeToFile();
	printf("%f",seconds());
	while(1) //black_button
	{
		if (a_button()){
			testDrive();
		}
		if (b_button()){
			testDetectPVC();
		}
		if (up_button()){
			
		}
		if (down_button()){
			testTurnAdjust();
		}
		if (left_button()){
			testTurnCCW();
		}
		if (right_button()){
			testTurnCW();
		}	
	}
}
Example #8
0
struct vg_assembly *kissSimChooseWorld(struct __world *w)// display worlds and click on the one you want
{
	int x,y,i=0;
	char *bb2012Title="Botball 2012", *bb2011Title="Botball 2011", *arenaTitle="2010 Arena", *emptyTitle ="Empty World", *blankTitle = "Blank World";
	
	// *****BB2010 Arena World********************
	struct vg_object *arenaObj00=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj01=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj02=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj03=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj04=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj05=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj06=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj07=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj08=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj09=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj10=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj11=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj12=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj13=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj14=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj15=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj16=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj17=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj18=malloc(sizeof(struct vg_object));
	struct vg_object *arenaObj19=malloc(sizeof(struct vg_object));
	struct vg_assembly *arena=malloc(sizeof(struct vg_assembly));
	
	// *****Empty World********************
	struct vg_object *emptyObj00=malloc(sizeof(struct vg_object));
	struct vg_object *emptyObj01=malloc(sizeof(struct vg_object));
	struct vg_object *emptyObj02=malloc(sizeof(struct vg_object));
	struct vg_object *emptyObj03=malloc(sizeof(struct vg_object));
	struct vg_assembly *empty=malloc(sizeof(struct vg_assembly));
	
	// *****Blank World********************
	struct vg_object *blankObj00=malloc(sizeof(struct vg_object));
	struct vg_object *blankObj01=malloc(sizeof(struct vg_object));
	struct vg_object *blankObj02=malloc(sizeof(struct vg_object));
	struct vg_object *blankObj03=malloc(sizeof(struct vg_object));
	struct vg_assembly *blank=malloc(sizeof(struct vg_assembly));
	
	struct vg_assembly *blankTape=malloc(sizeof(struct vg_assembly));
	
	// *****Tape and oil slicks********************
	struct vg_object *arena2010tapeObj00=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj01=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj02=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj03=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj04=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj05=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj06=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj07=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj08=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj09=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj10=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj11=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj12=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj13=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj14=malloc(sizeof(struct vg_object));
	struct vg_object *arena2010tapeObj15=malloc(sizeof(struct vg_object));
	struct vg_assembly *arena2010tape=malloc(sizeof(struct vg_assembly));
	
	// *****2012 PVC********************
	// declare pointer variables to the parts of the assembly and the assembly
	struct vg_object *bb2012Obj00=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj01=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj02=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj03=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj04=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj05=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj06=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj07=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj08=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj09=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj10=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj11=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj12=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj13=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj14=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj15=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj16=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj17=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012Obj18=malloc(sizeof(struct vg_object));
	struct vg_assembly *bb2012=malloc(sizeof(struct vg_assembly));
	
	// *****2012 Tape********************
	struct vg_object *bb2012TapeObj00=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj01=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj02=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj03=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj04=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj05=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj06=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj07=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj08=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj09=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj10=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj11=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj12=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj13=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj14=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj15=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj16=malloc(sizeof(struct vg_object));
	struct vg_object *bb2012TapeObj17=malloc(sizeof(struct vg_object));
	struct vg_assembly *bb2012Tape=malloc(sizeof(struct vg_assembly));
	
	// *****2011 PVC********************
	// declare pointer variables to the parts of the assembly and the assembly
	struct vg_object *bb2011Obj00=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj01=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj02=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj03=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj04=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj05=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj06=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj07=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj08=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj09=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj10=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj11=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj12=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj13=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj14=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj15=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj16=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj17=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011Obj18=malloc(sizeof(struct vg_object));
	struct vg_assembly *bb2011=malloc(sizeof(struct vg_assembly));
	
	
	//*****2011 Tape********************
	//declare pointer variables to the parts of the assembly and the assembly
	struct vg_object *bb2011TapeObj00=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj01=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj02=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj03=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj04=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj05=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj06=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj07=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj08=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj09=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj10=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj11=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj12=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj13=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj14=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj15=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj16=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj17=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj18=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj19=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj20=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj21=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj22=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj23=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj24=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj25=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj26=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj27=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj28=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj29=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj30=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj31=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj32=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj33=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj34=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj35=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj36=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj37=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj38=malloc(sizeof(struct vg_object));
	struct vg_object *bb2011TapeObj39=malloc(sizeof(struct vg_object));
	struct vg_assembly *bb2011Tape=malloc(sizeof(struct vg_assembly));
	
	
	//declare background color values to use in graphics_fill
	int fill_r=255, fill_g=255, fill_b=255;
	//end of Declarations...
	
	//******BB2012 Arena World Coordiantes
	
	// Board sides
	vg_make_line(bb2012Obj00,0.0,0.00,244.00,0.00,255,255,255,200,200,200);
	vg_make_line(bb2012Obj01,244.00,0.00,244.00,244.00,255,255,255,200,200,200);
	bb2012Obj00->next=bb2012Obj01;
	vg_make_line(bb2012Obj02,244.00,244.00,0.00,244.00,255,255,255,200,200,200);
	bb2012Obj01->next=bb2012Obj02;
	vg_make_line(bb2012Obj03,0.00,244.00,0.00,0.00,255,255,255,200,200,200);
	bb2012Obj02->next=bb2012Obj03;
	
	// protected reef
	vg_make_line(bb2012Obj04,16.00,0.00,16.00,31.00,255,255,255,200,200,200);
	bb2012Obj03->next=bb2012Obj04;
	vg_make_line(bb2012Obj05,0.00,31.00,16.00,31.00,255,255,255,200,200,200);
	bb2012Obj04->next=bb2012Obj05;
	vg_make_line(bb2012Obj06,228.00,213.00,244.00,213.00,255,255,255,200,200,200);
	bb2012Obj05->next=bb2012Obj06;
	vg_make_line(bb2012Obj07,228.00,213.00,228.00,244.00,255,255,255,200,200,200);
	bb2012Obj06->next=bb2012Obj07;
	
	// Divider wall
	vg_make_line(bb2012Obj08,0.00,122.00,76.00,122.00,255,255,255,200,200,200);
	bb2012Obj07->next=bb2012Obj08;
	vg_make_line(bb2012Obj09,168.00,122.00,244.00,122.00,255,255,255,200,200,200);
	bb2012Obj08->next=bb2012Obj09;
	
	// Starting box
	vg_make_line(bb2012Obj10,183.00,38.00,244.00,38.00,255,255,255,200,200,200);
	bb2012Obj09->next=bb2012Obj10;
	vg_make_line(bb2012Obj11,0.00,206.00,61.00,206.00,255,255,255,200,200,200);
	bb2012Obj10->next=bb2012Obj11;
	
	vg_make_assembly(bb2012, 12, 0.00, 0.00, 0.00, bb2012Obj00);
	vg_calculate_assembly_collision_parameters(bb2012);
	bb2012->partsCollision=1;
	bb2012->x=80;
	bb2012->y=25;
	//*****End of Your model code:********************
	
	// 2012 Tape //
	
	// First starting box
	vg_make_triangle_fill(bb2012TapeObj00,178.00,0.00,183.00,0.00,178.00,38.00,0,0,0,200,200,200);
	vg_make_triangle_fill(bb2012TapeObj01,178.00,38.00,183.00,38.00,183.00,0.00,0,0,0,200,200,200);//
	bb2012TapeObj00->next=bb2012TapeObj01;
	
	// Second starting box
	vg_make_triangle_fill(bb2012TapeObj02,61.00,206.00,66.00,206.00,61.00,244.00,0,0,0,200,200,200);
	bb2012TapeObj01->next=bb2012TapeObj02;
	vg_make_triangle_fill(bb2012TapeObj03,61.00,244.00,66.00,244.00,66.00,206.00,0,0,0,200,200,200);//
	bb2012TapeObj02->next=bb2012TapeObj03;
	
	// First tape thing
	vg_make_triangle_fill(bb2012TapeObj04,59.00,0.00,64.00,0.00,96.00,90.00,0,0,0,200,200,200);
	bb2012TapeObj03->next=bb2012TapeObj04;
	vg_make_triangle_fill(bb2012TapeObj05,96.00,90.00,101.00,90.00,64.00,0.00,0,0,0,200,200,200);//
	bb2012TapeObj04->next=bb2012TapeObj05;
	vg_make_triangle_fill(bb2012TapeObj06,96.00,90.00,101.00,90.00,96.00,122.00,0,0,0,200,200,200);
	bb2012TapeObj05->next=bb2012TapeObj06;
	vg_make_triangle_fill(bb2012TapeObj07,96.00,122.00,101.00,122.00,101.00,90.00,0,0,0,200,200,200);//
	bb2012TapeObj06->next=bb2012TapeObj07;
	
	// Second tape thing
	vg_make_triangle_fill(bb2012TapeObj08,143.00,122.00,148.00,122.00,143.00,154.00,0,0,0,200,200,200);
	bb2012TapeObj07->next=bb2012TapeObj08;
	vg_make_triangle_fill(bb2012TapeObj09,143.00,154.00,148.00,154.00,148.00,122.00,0,0,0,200,200,200);//
	bb2012TapeObj08->next=bb2012TapeObj09;
	vg_make_triangle_fill(bb2012TapeObj10,143.00,154.00,148.00,154.00,180.00,244.00,0,0,0,200,200,200);
	bb2012TapeObj09->next=bb2012TapeObj10;
	vg_make_triangle_fill(bb2012TapeObj11,180.00,244.00,185.00,244.00,148.00,154.00,0,0,0,200,200,200);//
	bb2012TapeObj10->next=bb2012TapeObj11;
	
	// Middle tape
	vg_make_triangle_fill(bb2012TapeObj12,76.00,120.00,76.00,124.00,168.00,124.00,0,0,0,200,200,200);
	bb2012TapeObj11->next=bb2012TapeObj12;
	vg_make_triangle_fill(bb2012TapeObj13,168.00,124.00,168.00,120.00,76.00,120.00,0,0,0,200,200,200);//
	bb2012TapeObj12->next=bb2012TapeObj13;
	
	// Green tape
	vg_make_triangle_fill(bb2012TapeObj14,1.00,1.00,15.00,1.00,1.00,30.00,0,200,0,200,200,200);
	bb2012TapeObj13->next=bb2012TapeObj14;
	vg_make_triangle_fill(bb2012TapeObj15,1.00,30.00,15.00,30.00,15.00,1.00,0,200,0,200,200,200);//
	bb2012TapeObj14->next=bb2012TapeObj15;
	
	// Pink tape
	vg_make_triangle_fill(bb2012TapeObj16,243.00,243.00,229.00,243.00,243.00,214.00,200,0,0,200,200,200);
	bb2012TapeObj15->next=bb2012TapeObj16;
	vg_make_triangle_fill(bb2012TapeObj17,243.00,214.00,229.00,214.00,229.00,243.00,200,0,0,200,200,200);//
	bb2012TapeObj16->next=bb2012TapeObj17;
	
	vg_make_assembly(bb2012Tape, 18, 0.00, 0.00, 0.00, bb2012TapeObj00);
	vg_calculate_assembly_collision_parameters(bb2012Tape);
	bb2012Tape->partsCollision=1;
	bb2012Tape->x=80;
	bb2012Tape->y=25;
	
	
	//******BB2011 Arean World Coordiantes
	vg_make_line(bb2011Obj00,0.000000,0.000000,244.000000,0.000000,255,255,255,200,200,200);
	vg_make_line(bb2011Obj01,244.000000,0.000000,244.000000,244.000000,255,255,255,200,200,200);
	bb2011Obj00->next=bb2011Obj01;
	vg_make_line(bb2011Obj02,244.000000,244.000000,0.000000,244.000000,255,255,255,200,200,200);
	bb2011Obj01->next=bb2011Obj02;
	vg_make_line(bb2011Obj03,0.000000,244.000000,0.000000,0.000000,255,255,255,200,200,200);
	bb2011Obj02->next=bb2011Obj03;
	vg_make_line(bb2011Obj04,109.000000,0.000000,109.000000,81.000000,255,255,255,200,200,200);
	bb2011Obj03->next=bb2011Obj04;
	vg_make_line(bb2011Obj05,135.000000,0.000000,135.000000,81.000000,255,255,255,200,200,200);
	bb2011Obj04->next=bb2011Obj05;
	vg_make_line(bb2011Obj06,109.000000,63.000000,135.000000,63.000000,255,255,255,200,200,200);
	bb2011Obj05->next=bb2011Obj06;
	vg_make_line(bb2011Obj07,109.000000,165.000000,109.000000,244.000000,255,255,255,200,200,200);
	bb2011Obj06->next=bb2011Obj07;
	vg_make_line(bb2011Obj08,135.000000,165.000000,135.000000,244.000000,255,255,255,200,200,200);
	bb2011Obj07->next=bb2011Obj08;
	vg_make_line(bb2011Obj09,109.000000,178.000000,135.000000,178.000000,255,255,255,200,200,200);
	bb2011Obj08->next=bb2011Obj09;
	vg_make_line(bb2011Obj10,0.000000,211.000000,109.000000,211.000000,255,255,255,200,200,200);
	bb2011Obj09->next=bb2011Obj10;
	vg_make_line(bb2011Obj11,135.000000,211.000000,244.000000,211.000000,255,255,255,200,200,200);
	bb2011Obj10->next=bb2011Obj11;
	vg_make_line(bb2011Obj12,53.000000,211.000000,53.000000,244.000000,255,255,255,200,200,200);
	bb2011Obj11->next=bb2011Obj12;
	vg_make_line(bb2011Obj13,191.000000,211.000000,191.000000,244.000000,255,255,255,200,200,200);
	bb2011Obj12->next=bb2011Obj13;
	vg_make_line(bb2011Obj14,0.000000,117.000000,10.000000,117.000000,255,255,255,200,200,200);
	bb2011Obj13->next=bb2011Obj14;
	vg_make_line(bb2011Obj15,234.000000,117.000000,244.000000,117.000000,255,255,255,200,200,200);
	bb2011Obj14->next=bb2011Obj15;
	/* vg_make_line(bb2011Obj16,56.000000,308.000000,159.000000,308.000000,255,255,255,200,200,200);
	bb2011Obj15->next=bb2011Obj16;
	vg_make_line(bb2011Obj17,-33.000000,309.000000,-33.000000,331.000000,255,255,255,200,200,200);
	bb2011Obj16->next=bb2011Obj17;
	vg_make_line(bb2011Obj18,109.000000,309.000000,108.000000,334.000000,255,255,255,200,200,200);
	bb2011Obj17->next=bb2011Obj18;*/
	vg_make_assembly(bb2011, 16, 0.000000, 0.000000, 0.000000, bb2011Obj00);
	vg_calculate_assembly_collision_parameters(bb2011);
	bb2011->partsCollision=1;
	bb2011->x=80;
	bb2011->y=25;
	//*****End of Your model code:********************
	
	
	
	//*****BB2010 Arena World Coordinates********************
	vg_make_line(arenaObj00,0.000000,0.000000,240.000000,0.000000,255,255,255,200,200,200);
	vg_make_line(arenaObj01,0.000000,0.000000,0.000000,90.000000,255,255,255,200,200,200);
	arenaObj00->next=arenaObj01;
	vg_make_line(arenaObj02,240.000000,0.000000,240.000000,120.000000,255,255,255,200,200,200);
	arenaObj01->next=arenaObj02;
	vg_make_line(arenaObj03,0.000000,90.000000,90.000000,90.000000,255,255,255,200,200,200);
	arenaObj02->next=arenaObj03;
	vg_make_line(arenaObj04,30.000000,90.000000,30.000000,120.000000,255,255,255,200,200,200);
	arenaObj03->next=arenaObj04;
	vg_make_line(arenaObj05,90.000000,90.000000,90.000000,120.000000,255,255,255,200,200,200);
	arenaObj04->next=arenaObj05;
	vg_make_line(arenaObj06,60.000000,90.000000,60.000000,240.000000,255,255,255,200,200,200);
	arenaObj05->next=arenaObj06;
	vg_make_line(arenaObj07,240.000000,120.000000,180.000000,120.000000,255,255,255,200,200,200);
	arenaObj06->next=arenaObj07;
	vg_make_line(arenaObj08,60.000000,210.000000,150.000000,210.000000,255,255,255,200,200,200);
	arenaObj07->next=arenaObj08;
	vg_make_line(arenaObj09,90.000000,150.000000,180.000000,150.000000,255,255,255,200,200,200);
	arenaObj08->next=arenaObj09;
	vg_make_line(arenaObj10,180.000000,120.000000,180.000000,270.000000,255,255,255,200,200,200);
	arenaObj09->next=arenaObj10;
	vg_make_line(arenaObj11,0.000000,240.000000,60.000000,240.000000,255,255,255,200,200,200);
	arenaObj10->next=arenaObj11;
	vg_make_line(arenaObj12,0.000000,240.000000,0.000000,360.000000,255,255,255,200,200,200);
	arenaObj11->next=arenaObj12;
	vg_make_line(arenaObj13,0.000000,360.000000,240.000000,360.000000,255,255,255,200,200,200);
	arenaObj12->next=arenaObj13;
	vg_make_line(arenaObj14,240.000000,360.000000,240.000000,270.000000,255,255,255,200,200,200);
	arenaObj13->next=arenaObj14;
	vg_make_line(arenaObj15,240.000000,270.000000,150.000000,270.000000,255,255,255,200,200,200);
	arenaObj14->next=arenaObj15;
	vg_make_line(arenaObj16,150.000000,270.000000,150.000000,240.000000,255,255,255,200,200,200);
	arenaObj15->next=arenaObj16;
	vg_make_line(arenaObj17,150.000000,240.000000,210.000000,240.000000,255,255,255,200,200,200);
	arenaObj16->next=arenaObj17;
	vg_make_line(arenaObj18,210.000000,240.000000,210.000000,270.000000,255,255,255,200,200,200);
	arenaObj17->next=arenaObj18;
	vg_make_line(arenaObj19,30.000000,120.000000,90.000000,120.000000,255,255,255,200,200,200);
	arenaObj18->next=arenaObj19;
	vg_make_assembly(arena, 20, 0.000000, 0.000000, 0.000000, arenaObj00);
	vg_calculate_assembly_collision_parameters(arena);
	arena->partsCollision=1;
	arena->x=80;
	arena->y=25;
	
	
	//*****Empty World Coordinates********************
	vg_make_line(emptyObj00,0.000000,0.000000,360.000000,0.000000,255,255,255,200,200,200);
	vg_make_line(emptyObj01,0.000000,0.000000,0.000000,360.000000,255,255,255,200,200,200);
	emptyObj00->next=emptyObj01;
	vg_make_line(emptyObj02,360.000000,0.000000,360.000000,360.000000,255,255,255,200,200,200);
	emptyObj01->next=emptyObj02;
	vg_make_line(emptyObj03,0.000000,360.000000,360.000000,360.000000,255,255,255,200,200,200);
	emptyObj02->next=emptyObj03;
	vg_make_assembly(empty, 4, 0.000000, 0.000000, 0.000000, emptyObj00);
	vg_calculate_assembly_collision_parameters(empty);
	empty->partsCollision=1;
	empty->x=20;
	empty->y=25;
	
	//*****blank World Coordinates********************
	vg_make_line(blankObj00,0.000000,0.000000,180.000000,0.000000,255,255,255,200,200,200);
	vg_make_line(blankObj01,0.000000,0.000000,0.000000,360.000000,255,255,255,200,200,200);
	blankObj00->next=blankObj01;
	vg_make_line(blankObj02,180.000000,0.000000,180.000000,360.000000,255,255,255,200,200,200);
	blankObj01->next=blankObj02;
	vg_make_line(blankObj03,0.000000,360.000000,180.000000,360.000000,255,255,255,200,200,200);
	blankObj02->next=blankObj03;
	vg_make_assembly(blank, 4, 0.000000, 0.000000, 0.000000, blankObj00);
	vg_calculate_assembly_collision_parameters(blank);
	blank->partsCollision=1;
	blank->x=80;
	blank->y=25;
	
	//****No Tape ***
	vg_make_assembly(blankTape, 0, 0.000000, 0.000000, 0.000000, blankObj00);
	
	
	//******Coordinates for tape and slicks*******************
	vg_make_triangle_fill(arena2010tapeObj00,58.000000,0.000000,58.000000,90.000000,62.000000,90.000000,0,255,0,200,200,200);
	vg_make_triangle_fill(arena2010tapeObj01,58.000000,0.000000,62.000000,0.000000,62.000000,90.000000,0,255,0,200,200,200);
	arena2010tapeObj00->next=arena2010tapeObj01;
	vg_make_triangle_fill(arena2010tapeObj02,88.000000,0.000000,88.000000,90.000000,92.000000,90.000000,255,0,0,200,200,200);
	arena2010tapeObj01->next=arena2010tapeObj02;
	vg_make_triangle_fill(arena2010tapeObj03,88.000000,0.000000,92.000000,0.000000,92.000000,90.000000,255,0,0,200,200,200);
	arena2010tapeObj02->next=arena2010tapeObj03;
	vg_make_triangle_fill(arena2010tapeObj04,148.000000,270.000000,148.000000,360.000000,152.000000,360.000000,255,0,0,200,200,200);
	arena2010tapeObj03->next=arena2010tapeObj04;
	vg_make_triangle_fill(arena2010tapeObj05,148.000000,270.000000,152.000000,270.000000,152.000000,360.000000,255,0,0,200,200,200);
	arena2010tapeObj04->next=arena2010tapeObj05;
	vg_make_triangle_fill(arena2010tapeObj06,178.000000,270.000000,178.000000,360.000000,182.000000,360.000000,0,255,0,200,200,200);
	arena2010tapeObj05->next=arena2010tapeObj06;
	vg_make_triangle_fill(arena2010tapeObj07,178.000000,270.000000,182.000000,270.000000,182.000000,360.000000,0,255,0,200,200,200);
	arena2010tapeObj06->next=arena2010tapeObj07;
	vg_make_circle_fill(arena2010tapeObj08,90.000000,30.000000,5.000000,0,0,0,200,200,200);
	arena2010tapeObj07->next=arena2010tapeObj08;
	vg_make_circle_fill(arena2010tapeObj09,150.000000,30.000000,12.000000,0,0,0,200,200,200);
	arena2010tapeObj08->next=arena2010tapeObj09;
	vg_make_circle_fill(arena2010tapeObj10,210.000000,30.000000,8.000000,0,0,0,200,200,200);
	arena2010tapeObj09->next=arena2010tapeObj10;
	vg_make_circle_fill(arena2010tapeObj11,210.000000,90.000000,12.000000,0,0,0,200,200,200);
	arena2010tapeObj10->next=arena2010tapeObj11;
	vg_make_circle_fill(arena2010tapeObj12,150.000000,330.000000,5.000000,0,0,0,200,200,200);
	arena2010tapeObj11->next=arena2010tapeObj12;
	vg_make_circle_fill(arena2010tapeObj13,90.000000,330.000000,12.000000,0,0,0,200,200,200);
	arena2010tapeObj12->next=arena2010tapeObj13;
	vg_make_circle_fill(arena2010tapeObj14,30.000000,330.000000,8.000000,0,0,0,200,200,200);
	arena2010tapeObj13->next=arena2010tapeObj14;
	vg_make_circle_fill(arena2010tapeObj15,30.000000,270.000000,12.000000,0,0,0,200,200,200);
	arena2010tapeObj14->next=arena2010tapeObj15;
	vg_make_assembly(arena2010tape, 16, 0.000000, 0.000000, 0.000000, arena2010tapeObj00);
	vg_calculate_assembly_collision_parameters(arena2010tape);
	arena2010tape->partsCollision=1;
	arena2010tape->x=80;
	arena2010tape->y=25;
	//*****End of Your model code:********************
	
	
	//******** BB 2011 Tape
	vg_make_triangle_fill(bb2011TapeObj00,38.000000,1.000000,38.000000,38.000000,43.000000,38.000000,0,0,0,200,200,200);
	vg_make_triangle_fill(bb2011TapeObj01,43.000000,38.000000,43.000000,1.000000,38.000000,1.000000,0,0,0,200,200,200);//
	bb2011TapeObj00->next=bb2011TapeObj01;
	vg_make_triangle_fill(bb2011TapeObj02,1.000000,43.000000,43.000000,43.000000,1.000000,38.000000,0,0,0,200,200,200);
	bb2011TapeObj01->next=bb2011TapeObj02;
	vg_make_triangle_fill(bb2011TapeObj03,1.000000,38.000000,43.000000,38.000000,43.000000,43.000000,0,0,0,200,200,200);//
	bb2011TapeObj02->next=bb2011TapeObj03;
	vg_make_triangle_fill(bb2011TapeObj04,1.000000,92.000000,15.000000,92.000000,15.000000,97.000000,0,0,0,200,200,200);
	bb2011TapeObj03->next=bb2011TapeObj04;
	vg_make_triangle_fill(bb2011TapeObj05,15.000000,97.000000,1.000000,92.000000,1.000000,97.000000,0,0,0,200,200,200);//
	bb2011TapeObj04->next=bb2011TapeObj05;
	vg_make_triangle_fill(bb2011TapeObj06,15.000000,92.000000,20.000000,92.000000,20.000000,142.000000,0,0,0,200,200,200);
	bb2011TapeObj05->next=bb2011TapeObj06;
	vg_make_triangle_fill(bb2011TapeObj07,20.000000,142.000000,15.000000,142.000000,15.000000,92.000000,0,0,0,200,200,200);//
	bb2011TapeObj06->next=bb2011TapeObj07;
	vg_make_triangle_fill(bb2011TapeObj08,1.000000,137.000000,1.000000,142.000000,20.000000,142.000000,0,0,0,200,200,200);
	bb2011TapeObj07->next=bb2011TapeObj08;
	vg_make_triangle_fill(bb2011TapeObj09,20.000000,142.000000,1.000000,142.000000,20.000000,137.000000,0,0,0,200,200,200);//
	bb2011TapeObj08->next=bb2011TapeObj09;
	vg_make_triangle_fill(bb2011TapeObj10,20.000000,210.000000,25.000000,210.000000,20.000000,178.000000,0,0,0,200,200,200);
	bb2011TapeObj09->next=bb2011TapeObj10;
	vg_make_triangle_fill(bb2011TapeObj11,20.000000,178.000000,25.000000,178.000000,25.000000,210.000000,0,0,0,200,200,200);//
	bb2011TapeObj10->next=bb2011TapeObj11;
	vg_make_triangle_fill(bb2011TapeObj12,20.000000,178.000000,25.000000,179.000000,109.000000,82.000000,0,0,0,200,200,200);
	bb2011TapeObj11->next=bb2011TapeObj12;
	vg_make_triangle_fill(bb2011TapeObj13,109.000000,82.000000,109.000000,87.000000,25.000000,179.000000,0,0,0,200,200,200);//
	bb2011TapeObj12->next=bb2011TapeObj13;
	vg_make_triangle_fill(bb2011TapeObj14,54.000000,205.000000,54.000000,210.000000,108.000000,210.000000,0,0,0,200,200,200);
	bb2011TapeObj13->next=bb2011TapeObj14;
	vg_make_triangle_fill(bb2011TapeObj15,108.000000,210.000000,108.000000,205.000000,54.000000,205.000000,0,0,0,200,200,200);//
	bb2011TapeObj14->next=bb2011TapeObj15;
	vg_make_triangle_fill(bb2011TapeObj16,136.000000,205.000000,190.000000,205.000000,190.000000,210.000000,0,0,0,200,200,200);
	bb2011TapeObj15->next=bb2011TapeObj16;
	vg_make_triangle_fill(bb2011TapeObj17,190.000000,210.000000,136.000000,210.000000,136.000000,205.000000,0,0,0,200,200,200);//
	bb2011TapeObj16->next=bb2011TapeObj17;
	vg_make_triangle_fill(bb2011TapeObj18,219.000000,210.000000,224.000000,210.000000,224.000000,178.000000,0,0,0,200,200,200);
	bb2011TapeObj17->next=bb2011TapeObj18;
	vg_make_triangle_fill(bb2011TapeObj19,224.000000,178.000000,219.000000,178.000000,219.000000,210.000000,0,0,0,200,200,200);//
	bb2011TapeObj18->next=bb2011TapeObj19;
	vg_make_triangle_fill(bb2011TapeObj20,219.000000,178.000000,224.000000,178.000000,135.000000,82.000000,0,0,0,200,200,200);
	bb2011TapeObj19->next=bb2011TapeObj20;
	vg_make_triangle_fill(bb2011TapeObj21,135.000000,82.000000,135.000000,87.000000,219.000000,179.000000,0,0,0,200,200,200);//
	bb2011TapeObj20->next=bb2011TapeObj21;
	vg_make_triangle_fill(bb2011TapeObj22,224.000000,137.000000,224.000000,142.000000,243.000000,137.000000,0,0,0,200,200,200);
	bb2011TapeObj21->next=bb2011TapeObj22;
	vg_make_triangle_fill(bb2011TapeObj23,243.000000,137.000000,243.000000,142.000000,224.000000,142.000000,0,0,0,200,200,200);//
	bb2011TapeObj22->next=bb2011TapeObj23;
	vg_make_triangle_fill(bb2011TapeObj24,224.000000,142.000000,228.000000,142.000000,228.000000,92.000000,0,0,0,200,200,200);
	bb2011TapeObj23->next=bb2011TapeObj24;
	vg_make_triangle_fill(bb2011TapeObj25,228.000000,92.000000,224.000000,92.000000,224.000000,142.000000,0,0,0,200,200,200);//
	bb2011TapeObj24->next=bb2011TapeObj25;
	vg_make_triangle_fill(bb2011TapeObj26,224.000000,92.000000,243.000000,92.000000,243.000000,97.000000,0,0,0,200,200,200);
	bb2011TapeObj25->next=bb2011TapeObj26;
	vg_make_triangle_fill(bb2011TapeObj27,243.000000,97.000000,224.000000,97.000000,224.000000,92.000000,0,0,0,200,200,200);//
	bb2011TapeObj26->next=bb2011TapeObj27;
	vg_make_triangle_fill(bb2011TapeObj28,201.000000,1.000000,206.000000,1.000000,206.000000,42.000000,0,0,0,200,200,200);
	bb2011TapeObj27->next=bb2011TapeObj28;
	vg_make_triangle_fill(bb2011TapeObj29,206.000000,42.000000,201.000000,42.000000,201.000000,1.000000,0,0,0,200,200,200);//
	bb2011TapeObj28->next=bb2011TapeObj29;
	vg_make_triangle_fill(bb2011TapeObj30,201.000000,38.000000,201.000000,42.000000,243.000000,42.000000,0,0,0,200,200,200);
	bb2011TapeObj29->next=bb2011TapeObj30;
	vg_make_triangle_fill(bb2011TapeObj31,243.000000,42.000000,243.000000,38.000000,201.000000,38.000000,0,0,0,200,200,200);//
	bb2011TapeObj30->next=bb2011TapeObj31;
	vg_make_triangle_fill(bb2011TapeObj32,66.000000,1.000000,66.000000,43.000000,71.000000,43.000000,0,0,0,200,200,200);
	bb2011TapeObj31->next=bb2011TapeObj32;
	vg_make_triangle_fill(bb2011TapeObj33,71.000000,43.000000,71.000000,1.000000,66.000000,1.000000,0,0,0,200,200,200);//
	bb2011TapeObj32->next=bb2011TapeObj33;
	vg_make_triangle_fill(bb2011TapeObj34,66.000000,43.000000,66.000000,38.000000,173.000000,38.000000,0,0,0,200,200,200);
	bb2011TapeObj33->next=bb2011TapeObj34;
	vg_make_triangle_fill(bb2011TapeObj35,173.000000,38.000000,173.000000,43.000000,66.000000,43.000000,0,0,0,200,200,200);//
	bb2011TapeObj34->next=bb2011TapeObj35;
	vg_make_triangle_fill(bb2011TapeObj36,173.000000,43.000000,173.000000,1.000000,178.000000,1.000000,0,0,0,200,200,200);
	bb2011TapeObj35->next=bb2011TapeObj36;
	vg_make_triangle_fill(bb2011TapeObj37,178.000000,1.000000,178.000000,43.000000,173.000000,43.000000,0,0,0,200,200,200);//
	bb2011TapeObj36->next=bb2011TapeObj37;
	vg_make_triangle_fill(bb2011TapeObj38,109.000000,64.000000,135.000000,64.000000,135.000000,177.000000,0,0,0,200,200,200);
	bb2011TapeObj37->next=bb2011TapeObj38;
	vg_make_triangle_fill(bb2011TapeObj39,135.000000,177.000000,109.000000,177.000000,109.000000,64.000000,0,0,0,200,200,200);
	bb2011TapeObj38->next=bb2011TapeObj39;
	vg_make_assembly(bb2011Tape, 40, 0.000000, 0.000000, 0.000000, bb2011TapeObj00);
	vg_calculate_assembly_collision_parameters(bb2011Tape);
	bb2011Tape->partsCollision=1;
	bb2011Tape->x=80;
	bb2011Tape->y=25;
	//*****End of Your model code:********************
	
	
	while(kiss_get_mouse_button(0));
	while(!kiss_get_mouse_button(0)){
		// 2012
		graphics_fill(200,200,200);		
		NOBOLD g_printString("2012 Board: SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",20, 10,TEAL,1.0);
		//NOBOLD g_printString(arenaTitle,20, +20,TEAL,3.0);
		vg_draw_assembly(bb2012,DRAW);
		graphics_update();
		while(!right_button()){
			if(kiss_get_mouse_button(0)){
				w->simPaused = 0;
				w->title=bb2012Title;
				w->obstacles= bb2012;
				w->markings=bb2012Tape;//*************************update
				NOBOLD g_printString("2012 BOARD: SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",20, 10,200,200,200,1.0);
				return;
			}
		}	
		vg_draw_assembly(bb2012,ERASE);
		while(right_button());
		
		// 2011
		graphics_fill(200,200,200);
		NOBOLD g_printString("2011 Board: SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",20, 10,TEAL,1.0);
		//NOBOLD g_printString(arenaTitle,20, +20,TEAL,3.0);
		vg_draw_assembly(bb2011,DRAW);
		graphics_update();
		while(!right_button()){
			if(kiss_get_mouse_button(0)){
				w->simPaused = 0;
				w->title=bb2011Title;
				w->obstacles= bb2011;
				w->markings=bb2011Tape;//*************************update
				NOBOLD g_printString("2011 BOARD: SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",20, 10,200,200,200,1.0);
				return;
			}
		}	
		vg_draw_assembly(bb2011,ERASE);
		while(right_button());
		graphics_fill(200,200,200);		
		//NOBOLD g_printString(emptyTitle,20, +20,TEAL,3.0);
		vg_draw_assembly(empty,DRAW);
		NOBOLD g_printString("Empty with 2011 Tape: SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",20, 10,TEAL,1.0);
		graphics_update();
		while(!right_button()){
			if(kiss_get_mouse_button(0)){
				w->simPaused =0;
				w->title=emptyTitle;
				w->obstacles= empty;	
				w->markings=bb2011Tape;
				NOBOLD g_printString("EMPTY WITH 2011 TAPE: SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",20, 10,200,200,200,1.0);
				return;
			}
		}	
		vg_draw_assembly(empty,ERASE); 
		while(right_button());
		graphics_fill(200,200,200);		
		//NOBOLD g_printString(blankTitle,20, +20,TEAL,3.0);
		vg_draw_assembly(blank,DRAW);
		NOBOLD g_printString("BLANK WORLD: SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",20, 10,TEAL,1.0);
		graphics_update();
		while(!right_button()){
			if(kiss_get_mouse_button(0)){
				w->simPaused =0;
				w->title=blankTitle;
				w->obstacles= blank;	
				w->markings=blankTape;
				NOBOLD g_printString("BLANK WORLD: SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",20, 10,200,200,200,1.0);
				return;
				}
				}	
				vg_draw_assembly(blank,ERASE); 
				while(right_button());
				graphics_fill(200,200,200);		
				NOBOLD g_printString("2010 Board: SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",20, 10,TEAL,1.0);
				vg_draw_assembly(arena,DRAW);
				graphics_update();
				while(!right_button()){
				if(kiss_get_mouse_button(0)){
				w->simPaused = 0;
				w->title=arenaTitle;
				w->obstacles= arena;
				w->markings=arena2010tape;
				NOBOLD g_printString("2010 BOARD: SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",5, 10,200,200,200,1.0);
				return;
				}
				}	
				vg_draw_assembly(arena,ERASE);
				while(right_button());
				graphics_fill(200,200,200);		
				NOBOLD g_printString("Empty with 2010 tape: SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",20, 10,TEAL,1.0);
				//graphics_fill(200,200,200);		
				//NOBOLD g_printString("SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",20, 10,TEAL,1.0);
				//NOBOLD g_printString(emptyTitle,20, +20,TEAL,3.0);
				vg_draw_assembly(empty,DRAW);
				graphics_update();
				while(!right_button()){
				if(kiss_get_mouse_button(0)){
				w->simPaused =0;
				w->title=emptyTitle;
				w->obstacles= empty;	
				w->markings=arena2010tape;
				NOBOLD g_printString("EMPTY WITH 2010 TAPE: SELECT WORLD WITH MOUSE CLICK, USE RIGHT ARROW KEY TO SWITCH",20, 10,200,200,200,1.0);
				return;
				}
				}	
				vg_draw_assembly(empty,ERASE); 
				while(right_button());
				}
				}
Example #9
0
File: botball.c Project: CBCJVM/cbc
void wait_for_light(int light_port_)
{
        int l_on_, l_off_, l_mid_, t, OK=0;
        int p; // temp until tone is implemented
        float s;

        while (!OK) {
                cbc_display_clear();
                cbc_printf (0,0,"CALIBRATE: sensor port #%d", light_port_);
                sleep(1.); beep(); sleep(1.);

                cbc_printf(0,1,"  press <-- when light on");
                while(!left_button()){/*sensor value when light is on*/
                        cbc_printf(0,2,"  value is %d, bright = low   ",l_on_=analog10 (light_port_));
                        msleep(50);
                }
                beep();

                cbc_printf(0,1,"  light on value is = %d        ", l_on_);
                sleep(1.);
                beep();

                cbc_printf(0,2,"  press --> when light off             ");
                while(!right_button()){	/*sensor value when light is off*/
                        cbc_printf(0,3,"   value is %d, dark = high   ",l_off_=analog10 (light_port_));
                        msleep(50);
                }
                beep();

                cbc_printf(0,2,"  light off value is = %d         ", l_off_);
                sleep(1.);
                beep();

                cbc_printf(0,3,"                              ");

                if((l_off_-l_on_)>=120){ /*bright = small values */
                        OK=1;
                        l_mid_=(l_on_+l_off_)/2;
                        cbc_printf(0,4,"Good Calibration!");
                        cbc_printf(0,6,"Diff = %d:  WAITING",l_off_-l_on_);
                        p=start_process(beeper1);
                        while(analog10(light_port_)>l_mid_){
                                cbc_printf(0,7,"Value = %d; Threshold = %d   ",analog10(light_port_),l_mid_);
                                msleep(25);
                        }
                        cbc_printf(0,6,"Going!                      ");
                        cbc_printf(0,7,"Value = %d; Threshold = %d   ",analog10(light_port_),l_mid_);
                        //kill_process(p); //works on cbc
                        __wfl_keep_beeping=0;//avoids kill process which has problems on Mac
                }
                else{
                        s=seconds();
                        cbc_printf(0,6,"BAD CALIBRATION");
                        if(l_off_<512){
                                cbc_printf(0,7,"   Add Shielding!!");
                                for(t=0; t<4; t++) {beep(); sleep(.2); beep(); sleep(0.4);}
                                beep();
                        }
                        else{
                                cbc_printf(0,7,"   Aim sensor!!");
                                for(t=0; t<4; t++) {beep(); sleep(.2); beep(); sleep(0.4);}
                                beep();
                        }
                }
        }
}
Example #10
0
void kissSimComputerDraw()
{
	int oriX=ksWindow.simWidth, oriY=0, i;
	static char digitals[]="0 0 0 0 0 0 0 0";
	static char buttons[]="0 0 0 0 0 0 0";
	static char analogs[11][10]={"         ","         ","         ","         ","         ","         ","         ","         ","         ","         ","         "};
	static char actuators[4][25]={"                        ","                        ","                        ","                        "};
	static char servos[4][25]={"                        ","                        ","                        ","                        "};
	if(!glfwGetWindowParam(GLFW_OPENED)) return;
	graphics_rectangle_fill(oriX,oriY,oriX+1,ksWindow.height,BLACK); // draw left border
	draw_bg(oriX+5,oriY+9,0.36); // Botguy
	NOBOLD g_printString(" CBC SIMULATOR",oriX+25, oriY+10,TEAL,1.0);
	NOBOLD g_printString("    DIGITALS  ",oriX+25, oriY+40,TEAL,1.0);
	NOBOLD g_printString("0 1 2 3 4 5 6 7",oriX+25, oriY+55,TEAL,1.0);
	NOBOLD g_printString("    BUTTONS  ",oriX+25, oriY+90,TEAL,1.0);
	//NOBOLD g_printString("< ^ V > A B .",oriX+30, oriY+105,TEAL,1.0);
	NOBOLD g_printString("\xb \xd \xe \xc A B .",oriX+30, oriY+105,TEAL,1.0);
    // hex b, c, d, e are left, right, up, and down arrows
	NOBOLD g_printString(digitals,oriX+25, oriY+70,WHITE,1.0); // erase old digital values
	NOBOLD g_printString("    ANALOGS  ",oriX+25, oriY+140,TEAL,1.0);
	for(i=0;i<8;i++){
		digitals[2*i]=48+digital(i);
	}
	NOBOLD g_printString(digitals,oriX+25, oriY+70,BLACK,1.0); // write new digital values
	NOBOLD g_printString(buttons,oriX+30, oriY+120,WHITE,1.0); // erase old button values
	buttons[0]=48+!!left_button();
	buttons[2]=48+!!up_button();
	buttons[4]=48+!!down_button();
	buttons[6]=48+!!right_button();
	buttons[8]=48+!!a_button();
	buttons[10]=48+!!b_button();
	_bob.button=!!kiss_get_key('.');
	buttons[12]=48+black_button();
	NOBOLD g_printString(buttons,oriX+30, oriY+120,BLACK,1.0); // erase old button values
	for(i=8;i<16;i++){//print out analogs
		analogs[i-8][1]=(i<10)?48+i:48+i-10;
		analogs[i-8][0]=(i<10)?32:49;
		analogs[i-8][2]=':';
		analogs[i-8][3]=' ';
		NOBOLD g_printString(analogs[i-8],oriX+5, oriY+155+(15*(i-8)),WHITE,1.0);
		convertNumToString(analog10(i),4,*analogs,10,i-8,3);
		graphics_rectangle_fill(oriX+30,oriY+155+(15*(i-8)),oriX+157, oriY+165+(15*(i-8)),GRAY);
		graphics_line(oriX+30+analog(i)/2, oriY+155+(15*(i-8)),oriX+30+analog(i)/2,oriY+165+(15*(i-8)),RED);
		NOBOLD g_printString(analogs[i-8],oriX+5, oriY+155+(15*(i-8)),BLACK,1.0);

	}
	analogs[8][1]='X';
	analogs[8][0]='A';
	analogs[8][2]=':';
	analogs[8][3]=' ';
	NOBOLD g_printString(analogs[8],oriX+5, oriY+155+(15*(8)),WHITE,1.0);
	convertNumToString(accel_x(),5,*analogs,10,8,3);
	graphics_rectangle_fill(oriX+30,oriY+155+(15*(8)),oriX+157, oriY+165+(15*(8)),GRAY);
	graphics_line(oriX+30+(accel_x()+2048)/32, oriY+155+(15*(8)),oriX+30+(accel_x()+2048)/32,oriY+165+(15*(8)),RED);
	NOBOLD g_printString(analogs[8],oriX+5, oriY+155+(15*(8)),BLACK,1.0);
	analogs[9][1]='Y';
	analogs[9][0]='A';
	analogs[9][2]=':';
	analogs[9][3]=' ';
	NOBOLD g_printString(analogs[9],oriX+5, oriY+155+(15*(9)),WHITE,1.0);
	convertNumToString(accel_y(),5,*analogs,10,9,3);
	graphics_rectangle_fill(oriX+30,oriY+155+(15*(9)),oriX+157, oriY+165+(15*(9)),GRAY);
	graphics_line(oriX+30+(accel_y()+2048)/32, oriY+155+(15*(9)),oriX+30+(accel_y()+2048)/32,oriY+165+(15*(9)),RED);
	NOBOLD g_printString(analogs[9],oriX+5, oriY+155+(15*(9)),BLACK,1.0);
	analogs[10][1]='Z';
	analogs[10][0]='A';
	analogs[10][2]=':';
	analogs[10][3]=' ';
	NOBOLD g_printString(analogs[10],oriX+5, oriY+155+(15*(10)),WHITE,1.0);
	convertNumToString(accel_z(),5,*analogs,10,10,3);
	graphics_rectangle_fill(oriX+30,oriY+155+(15*(10)),oriX+157, oriY+165+(15*(10)),GRAY);
	graphics_line(oriX+30+(accel_z()+2048)/32, oriY+155+(15*(10)),oriX+30+(accel_z()+2048)/32,oriY+165+(15*(10)),RED);
	NOBOLD g_printString(analogs[10],oriX+5, oriY+155+(15*(10)),BLACK,1.0);

	NOBOLD g_printString("MOT PWM TPS  ENCODER VAL",oriX+5, oriY+330,TEAL,1.0);
	for(i=0;i<4;i++){
		actuators[i][0]=48+i;
		actuators[i][1]=':';
		actuators[i][2]=' ';
		NOBOLD g_printString(actuators[i],oriX+5, oriY+345+(15*(i)),WHITE,1.0);
		convertNumToString(_bob.motor_pwm[i],4,*actuators,25,i,2);
		convertNumToString(_bob.motor_tps[i],4,*actuators,25,i,7);
		convertNumToString(_bob.motor_counter[i],10,*actuators,25,i,12);
		NOBOLD g_printString(actuators[i],oriX+5, oriY+345+(15*(i)),BLACK,1.0);
	}
	if(_bob.enable_servos){
		NOBOLD g_printString("SERVO TARGET DISABLED",oriX+5, oriY+410,WHITE,1.0);
		NOBOLD g_printString("SERVO TARGET ENABLED",oriX+5, oriY+410,TEAL,1.0);
	}
	else {
		NOBOLD g_printString("SERVO TARGET ENABLED",oriX+5, oriY+410,WHITE,1.0);
		NOBOLD g_printString("SERVO TARGET DISABLED",oriX+5, oriY+410,TEAL,1.0);
	}
	for(i=0;i<4;i++){
		servos[i][2]=49+i;//servos are 1 indexed!!
		servos[i][3]=':';
		servos[i][4]=' ';
		NOBOLD g_printString(servos[i],oriX+5, oriY+425+(15*(i)),WHITE,1.0);
		convertNumToString(_bob.servo_targets[i],4,*servos,25,i,6);
		NOBOLD g_printString(servos[i],oriX+5, oriY+425+(15*(i)),BLACK,1.0);
	}

}