// graphics_open(3*w,62);	
int blinkdown(int strt, int fin, int br, int bg, int bb, int dr, int dg, int db, int m, int w, int lports[], int pcnt)
{
	int i,j,d1,d2,d3,off=0,on=1;
	while(BCHK); // debounce
	for(i=strt;i>fin;i--) {
		for(j=0;j<5;j++) {
			table_lights(lports,pcnt,on); // table lights on
			graphics_fill(WHITE);
			graphics_update();
			msleep(100);
			if(BCHK) return 1;
			table_lights(lports,pcnt,off); // table lights off
			graphics_fill(br,bg,bb);
			d1=i/100; d2=(i%100)/10; d3=i%10;
			if (d1>0) digit(d1,m,dr,dg,db);
			if (d1>0 || d2>0) digit(d2,m+w,dr,dg,db);
			digit(d3,m+w+w,dr,dg,db);
			graphics_update();
			msleep(100);
			if(BCHK) return 1;
		}
	}	
	
	showtriple(0,dr,dg,db,m,w);
	return 0;
}
Exemplo n.º 2
0
int main()
{
	int i, off=0, on=1, lports[]=LIGHT_PORTS, pcnt, w=40, m=5;
	float s;
	graphics_open(320,240);
	for(i=0;i<256;i+=5) {
		graphics_fill(i,i,i);
		graphics_update();
	}
	SplashBG(320, 240);
	msleep(1000);
	graphics_close();
	pcnt=NPORTS(lports);
	for(i=8;i<16;i++) { // change the digital ports to output
		set_digital_output(i,1);
	}
	srand(time(NULL)); // prime random number generation
	while(1) { 
		table_lights(lports,pcnt,off); // shut off table lights
		setup(); // team setup (light calibration w/time out option)
		// setup done, including any time outs so proceed with judge's setup
		//get_shelf_positions(); // display orange/yellow block set up for judges - 2014
		get_bgal_pod_positions(); // display left-right positions for Botgal & pod - 2015
		set_a_button_text("QUIT");	set_b_button_text("-"); set_c_button_text("-");
		graphics_close();  // close any open graphics
		graphics_open(3*w,62);	
		display_clear();
		display_printf(0,0,"************** BOTBALL 2015 **************");
		display_printf(0,1,"               LIGHTS ON IN");
		display_printf(0,2,"******************************************");
		display_printf(0,9,"      Press QUIT to stop count down");
		if (countdown_sd(5,1,BLUE,YELLOW,m,w)) continue;
		s=seconds();
		// 2015
		table_lights(lports,pcnt,on); // on for 115 seconds	
		display_printf(0,1,"     GAME CLOCK - LIGHTS ON TILL 5");
		if (countdown(120,11,GREEN,BLUE,m,w)) continue;
		// end 2015
		/*
		// 2014	
		table_lights(lports,pcnt,on); // on for 15 seconds	
		display_printf(0,1,"     GAME CLOCK - LIGHTS ON TILL 105");
		if (countdown(120,106,GREEN,BLUE,m,w)) continue;
		table_lights(lports,pcnt,off); // of for 100 seconds	
		display_printf(0,1,"      GAME CLOCK - LIGHTS OFF TILL 5");
		if (countdown(105,11,LTBLUE,RED,m,w)) continue;
		// end 2014
		*/
		if (countdown(10,6,LTORANGE,BLUE,m,w)) continue;
		display_printf(0,1,"     GAME CLOCK - LIGHTS BLINK TILL 0");
		i=5+(seconds()-s);
		if (blinkdown(5,0,RED,YELLOW,m,w,lports,pcnt)) continue;
		display_printf(0,1,"            GAME CLOCK - %d          ",i);
		display_printf(0,9,"          ***** GAME OVER! *****     ");
		table_lights(lports,pcnt,off); // shut off table lights
		msleep(5000); // pause display
	}
	return 0;
}
Exemplo n.º 3
0
void kissSimLoadWorld(struct __world *w)
{
	w->simPaused=0;
	kissSimChooseWorld(w);
	printf("Selected %s\n",w->title);
	glfwSetWindowTitle(w->title);
	vg_draw_assembly(w->obstacles,ERASE);
	graphics_update();
}
Exemplo n.º 4
0
void Game::run() {
    // Prime the self-scheduling graphics loop by drawing the first frame.
    target_real_time_ = platform_.now();
    graphics_update();

    ui_.yield_func(boost::bind(&Game::ui_yield_func, this));

    // Give control to the UI event loop, will also periodically call our yield_func.
    ui_.event_loop();
}
Exemplo n.º 5
0
void blinking_light() {
	while(BCHK); // debounce
	graphics_close(); // close any existing window
	graphics_open(45,45);
	graphics_fill(WHITE);
	while(!(BCHK)) {
		graphics_circle_fill(24, 24, 20, GRAY);
		graphics_circle_fill(24, 24, 8, YELLOW);
		graphics_line(6, 24, 42, 24, YELLOW);  // horizontal
		graphics_line(24, 6, 24, 42, YELLOW);  // vertical
		graphics_line(12, 12, 36, 36, YELLOW); // forward slash
		graphics_line(12, 36, 36, 12, YELLOW); // back slash
		graphics_update(); 
		msleep(250);
		if(BCHK) break;
		graphics_circle_fill(24, 24, 20, GRAY);
		graphics_update();
		msleep(250);
	}
	graphics_close();
}
Exemplo n.º 6
0
int main(int argc, char *argv[])
{
	if(!graphics_open(640, 480)) return 0;
	
	while(1) {
		usleep(1);
		graphics_rectangle(0, 0, 30, 30, 255, 0, 0);
		graphics_update();
	}
	
	graphics_close();
	
	return 0;
}
// graphics_open(3*w,62);	
int countdown_sd(int strt, int fin, int br, int bg, int bb, int dr, int dg, int db, int m, int w) // single digit version
{
	int i,j,d1,d2,d3;
	while(BCHK); // debounce
	for(i=strt;i>=fin;i--) {
		graphics_fill(br,bg,bb);
		d1=i/100; d2=(i%100)/10; d3=i%10;
		digit(d3,m+w,dr,dg,db);
		graphics_update();
		for (j=0;j<4;j++) { // pause 1 second or quit
			if(BCHK) return 1;
			msleep(250);
		}
	}
	return 0;	
}
void get_bgal_pod_positions()
{
	// screen size (scols,srows), box size (bxcols,bxcols), separator m pixels
	// random block positions p1, p2 set by function picks
	int srows=120,scols=160, bpos, ppos;
	graphics_close(); // close any existing graphics window
	display_clear();  // prep screen
	set_a_button_text("COUNTDOWN");	set_b_button_text("-"); set_c_button_text("-");
	graphics_open(scols,srows);
	graphics_fill(WHITE);
	bpos=rand()%2;
	if (bpos==0) ppos=1;
	else ppos=0;	
	// draw field
	graphics_rectangle(3,3,157,117,BLACK);        // outline
	graphics_rectangle(3,3,70,50,BLACK);          // quads
	graphics_rectangle(90,3,157,50,BLACK);
	graphics_rectangle(3,70,70,117,BLACK);
	graphics_rectangle(90,70,157,117,BLACK);
	graphics_rectangle_fill(70,3,90,50,LTBROWN);         // mesa
	graphics_rectangle(70,3,90,50,BLACK);
	graphics_rectangle_fill(70,70,90,117,LTBROWN);
	graphics_rectangle(70,70,90,117,BLACK); 
	graphics_rectangle_fill(72,50,88,70,LTGRAY);  // caldera
	graphics_rectangle(72,50,88,70,BLACK);
	graphics_rectangle_fill(20,3,25,50,TEAL);     // lines
	graphics_rectangle_fill(135,3,140,50,TEAL);
	graphics_rectangle_fill(20,70,25,117,PINK);
	graphics_rectangle_fill(135,70,140,117,PINK);	
	if (bpos==0) { 
		draw_bg(73,13,0.2);
		graphics_rectangle_fill(74,87,86,102,GREEN);
	}
	else {
		draw_bg(73,82,0.2);
		graphics_rectangle_fill(74,18,86,32,GREEN);
	}
	graphics_update();
	
	display_printf(2,0,"Set Botgal and Botpod ");
	
	while(a_button()==0);
	while(a_button()==1); // debounce
}
Exemplo n.º 9
0
int main()
{
	camera_open();
	camera_update();
	graphics_open(get_camera_width(), get_camera_height());
	
	while(!get_key_state('Q'))
	{
		camera_update();
		graphics_blit_enc(get_camera_frame(), BGR, 0, 0, get_camera_width(), get_camera_height());
		graphics_circle_fill(get_camera_width() / 2, get_camera_height() / 2, get_camera_height() / 20, 255, 0, 0);
		graphics_update();
	}
	
	camera_close();
	graphics_close();
	
	return 0;
}
Exemplo n.º 10
0
int main(int argc, char ** argv)
{
	graphics_open(100,100);

	int x, j;
	for (j = 0; j < 10; ++j)
	{
		for (x = 0; x < 100; ++x)
		{
			graphics_clear();
			graphics_circle_fill(x, 50, 5, 255, 0, 0);
			graphics_update();
			msleep(10);
		}
	}

	graphics_close();

	return 0;
}
Exemplo n.º 11
0
void kissSimInBgd()
{
	int r,g,b,help=0;
	static int PenPrevious=0;
	while(!kiss_get_key('Q')){
		if(!kiss_get_key('P')){
			if(PenPrevious){
				PenPrevious=0;
				robot.pen=!robot.pen;
				if(robot.pen && robot.pixelCount==0){
					robot.pixel[0].x=robot.x;
					robot.pixel[0].y=robot.y;
					robot.pixelCount=1;
				}
			}
			PenPrevious=0;
		}
		else PenPrevious=1;
		if(kiss_get_key('H'))help=1;
		else help=0;
		kissSimRobotUpdate();
		kissSimComputerUpdate();
		if(!help && _world.simPaused)graphics_rectangle_fill(0,0,ksWindow.simWidth-1,ksWindow.simHeight-1,GRAY);
		else { 
			if(!help){
				kissSimComputerTone(&r,&g,&b);
				graphics_rectangle_fill(0,0,ksWindow.simWidth-1,ksWindow.simHeight-1,r,g,b);
			}
		}
		kissSimDrawObst();
		kissSimRobotDraw();
		kissSimComputerDraw();
		if(help){//print help screen
			graphics_rectangle_fill(0,0,ksWindow.simWidth-1,ksWindow.simHeight-1,255,200,200);// instruction background is light pink
			kissSimPrintInstructions();
		}
		graphics_update();
		msleep(20);
	}
	kissSim_end();
}
Exemplo n.º 12
0
void kissSim_init(int world, int rx, int ry, float rt)
{
  int i,splash=1;
  if(world<0){world=-world; splash=0;}//a negative world means no splash screen
	kissSimLoadWorld(world);//sets .world, .simHeight & .simWidth (leaving default values if sim is smaller)
	kissSimRobotDim(&ksWindow.rWidth, &ksWindow.rHeight);//set robot window dimensions
	ksWindow.height=ksWindow.simHeight+ksWindow.rHeight;//set overall window height
	kissSimComputerDim(&ksWindow.cWidth, &ksWindow.cHeight);//set computer window dimentsions
	ksWindow.width=ksWindow.simWidth+ksWindow.cWidth;//set overall window width
	graphics_init(ksWindow.width, ksWindow.height);
	graphics_fill(255,255,255);
	glfwSetWindowTitle(_world.title);
	// Draw the spash screen
	if(splash)kissSplashBG(ksWindow.width, ksWindow.height);
	robot.x=rx; robot.y=ry; robot.theta=rt;
	kissSimRobotInit();
	kissSimComputerInit();
	graphics_rectangle_fill(0,0,ksWindow.simWidth-1,ksWindow.simHeight-1,255,200,200);// instruction background is light pink
	kissSimPrintInstructions();
	graphics_update();
	while(!kiss_get_key(' '));while(kiss_get_key(' '));//pause until space bar is hit
	start_process(kissSimInBgd);
	kissSimPause();
}
// graphics_close()
void showtriple(int i, int r, int g, int b, int m, int w) 
{
	digit(i,m,r,g,b); digit(i,m+w,r,g,b); digit(i,m+w+w,r,g,b);
	graphics_update();
}
Exemplo n.º 14
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());
				}
				}
int main(int argc, char** argv)
{
  if(!depth_open())
  {
    printf("Unable to open libkipr_link_depth_sensor\n");
    return 1;
  }

  int depth_image_height = -1;
  int depth_image_width = -1;

  int mouse_x;
  int mouse_y;

  int last_max_depth = 6000 /* mm */;
  int max_depth;

  if(set_depth_camera_resolution(DEPTH_CAMERA_RESOLUTION_640_480) == 0)
  {
    printf("Failed to set the depth camera resolution to 640 x 480\n");
    return 1;
  }
  
#ifdef CAMERA_IS_UPSIDE_DOWN
  if(set_depth_camera_orientation(DEPTH_CAMERA_ORIENTATION_UPSIDE_DOWN) == 0)
  {
    printf("Failed to set the depth camera orientation\n");
    return 1;
  }
#endif

  printf("Press 'Q' to stop\n");

  while(!get_key_state('Q'))
  {
    if(depth_update())
    {
      if(depth_image_height == -1)
      {
        // initialize the graphics output
        depth_image_height = depth_image_get_height();
        depth_image_width = depth_image_get_width();

        graphics_open(depth_image_width, depth_image_height);
      }

      get_mouse_position(&mouse_x, &mouse_y);
      max_depth = 0;

      // display depth image
      for(int y = 0; y < depth_image_height; y++)
      {
        for(int x = 0; x < depth_image_width; x++)
        {
          int depth = get_depth_value(x, y);

          // save max depth
          if(depth > max_depth)
          {
            max_depth = depth;
          }

          // color invalid depth pixel red
          if((depth != INVALID_COORDINATE) && last_max_depth)
          {
            int r;
            int g;
            int b;

            HSVtoRGB(360*0xFF*depth/last_max_depth, &r, &g, &b);

            graphics_pixel(x, y, r, g, b);
          }
          else
          {
            graphics_pixel(x, y, 0xFF, 0xFF, 0xFF);
          }

          #ifdef SHOW_DEPTH_UNDER_MOUSE
            if(mouse_x == x && mouse_y == y)
            {
              console_clear();
              if(depth != INVALID_COORDINATE)
              {
                printf("(%d, %d): Depth: %d mm; World coordinate: (%d, %d, %d)\n", x, y, depth, get_world_x(x, y), get_world_y(x, y), get_world_z(x, y));
              }
              else
              {
                printf("(%d, %d): No information available\n", x, y);
              }
            }
          #endif
        }
      }

      last_max_depth = max_depth;

      graphics_update();
    }
    else
    {
      printf("No depth image received yet\n");
      msleep(2000);
    }
  }

  graphics_close();
  depth_close();

  return 0;
}
Exemplo n.º 16
0
int main(int argc, char** args)
{
	srand(time(NULL));

	int error;
	c_cpu_handle cpu;
	
	printf("Cuilien cell simulation.\n");

	printf("Initializing VM...\n");
	cpu = c_cpu_init();
	if(c_error_last)
	{
		c_error_print(c_error_last);
		return 1;
	}
	
	printf("Disabling a few opcodes...\n");
	c_instruction_vector[C_INSTR_PUTC] = NULL;
	c_instruction_vector[C_INSTR_GETC] = NULL;
	c_instruction_vector[C_INSTR_SHOW] = NULL;

	printf("Initializing IVT...\n");
	cpu->ivt = build_ivt();

	printf("Loading seed...\n");
	c_mem_handle seed = c_mem_init(MAX_CELL_MEMORY);
	c_mem_load_file(seed, "seed2.cx", 12);

	printf("Setting up graphics...\n");
	if((error = graphics_init()))
	{
		// TODO: handle error
		return 1;
	}
	
	printf("Creating world...\n");
	world_load(&world, "terrain3.bmp");
	graphics_init_world_image(world);

	printf("Spawning inital cells...\n");
	cells_init();

	champion_cell = cell_spawn(c_mem_copy(seed), 1, 0x00ff00, 5, 180, 200);
	champion_cell->save = true;

	cell_spawn(c_mem_copy(seed), 1, 0xff0000, 5, 1000, 200);
	// cell_spawn(c_mem_copy(seed), 0x0000ff, 5, 180, 600);
	// cell_spawn(c_mem_copy(seed), 0xffff00, 5, 1000, 600);
	
	printf("Ready.\n");
	
	while(!graphics_update() && cells_get_count())
	{
		world_update_waste(world);

		// simulate and render cells
		/* this turned out messier than I had envisioned it */
		int i = 0;
		while((current_cell = cell_next(&i)))
		{
			cpu->context = &current_cell->process.context;

			assert(cpu->context != NULL);
			assert(cpu->context->memory != NULL);

			int step;
			for(step = 0; step < 100 && current_cell->alive; ++step)
			{
				c_cpu_step(cpu);
			}

			if(current_cell->mass)
			{
				/* mass decay */
				--current_cell->mass;
			
				/* produce waste */
				tile_t* tile = world_get_tile(world, current_cell->x, current_cell->y);
				if(tile->waste != 255)
				{
					++tile->waste;
					graphics_update_world_image(current_cell->x, current_cell->y, tile);
				}
			}

			graphics_render_cell(current_cell);

			if(current_cell != champion_cell &&
					cell_lifetime(current_cell) >= cell_lifetime(champion_cell))
			{
				champion_cell->save = false;
				if(!champion_cell->alive)
					cell_kill(champion_cell);

				current_cell->save = true;
				champion_cell = current_cell;
			}

			if(current_cell->mass == 0 ||
					cell_lifetime(current_cell) > 1000) /* test death by age */
				cell_kill(current_cell);
		}

		++cycle;
	}

	printf("Champion: \n");
	printf(" * Color: %06X\n", champion_cell->color);
	printf(" * Generation: %d\n", champion_cell->generation);
	printf(" * Times split: %d\n", champion_cell->times_split);
	printf(" * Cycles lived: %d\n", cell_lifetime(champion_cell));
	printf(" * Time of birth: %d\n", champion_cell->birth);
	if(champion_cell->alive)
		printf(" * Time of death: ALIVE\n");
	else
		printf(" * Time of death: %d\n", champion_cell->death);
	printf(" * Place of death: %d, %d\n", champion_cell->x, champion_cell->y);
	c_mem_dump_to_file(champion_cell->process.context.memory, "champion.dump");
	printf("Memory dumped to champion.dump.\n");
	
	printf("Freeing memory...\n");
	cells_free();
	c_mem_free(seed);
	
	printf("Destroying graphics...\n");
	if((error = graphics_destroy()))
	{
		// TODO: handle error
		return 1;
	}

	printf("Freeing VM...\n");
	c_cpu_free(cpu);
	
	printf("Good bye!\n");
}