strcpy (pod3.line3, " + ");
strcpy (pod3.radar, "x");
- game_object pods[2] = { { pod2 }, { pod3 } };
+ game_object pod4;
+ pod4.number = 4;
+ pod4.active = 1;
+ pod4.x = 18; //always start on ground
+ pod4.y = rand()%620; //anywhere along the surface
+ pod4.direction = rand()%1000;
+ if(pod4.direction<500){
+ pod4.direction = 4;
+ } else {
+ pod4.direction = 6;
+ };
+ pod4.face = 0;
+ pod4.speed = 1;
+ strcpy (pod4.line0, " x ");
+ strcpy (pod4.line1, " x ");
+ strcpy (pod4.line2, " + ");
+ strcpy (pod4.line3, " + ");
+ strcpy (pod4.radar, "x");
+
+game_object pod5;
+ pod5.number = 5;
+ pod5.active = 1;
+ pod5.x = 18; //always start on ground
+ pod5.y = rand()%620; //anywhere along the surface
+ pod5.direction = rand()%1000;
+ if(pod5.direction<500){
+ pod5.direction = 4;
+ } else {
+ pod5.direction = 6;
+ };
+ pod5.face = 0;
+ pod5.speed = 1;
+ strcpy (pod5.line0, " x ");
+ strcpy (pod5.line1, " x ");
+ strcpy (pod5.line2, " + ");
+ strcpy (pod5.line3, " + ");
+ strcpy (pod5.radar, "x");
+
+game_object pod6;
+ pod6.number = 6;
+ pod6.active = 1;
+ pod6.x = 18; //always start on ground
+ pod6.y = rand()%620; //anywhere along the surface
+ pod6.direction = rand()%1000;
+ if(pod6.direction<500){
+ pod6.direction = 4;
+ } else {
+ pod6.direction = 6;
+ };
+ pod6.face = 0;
+ pod6.speed = 1;
+ strcpy (pod6.line0, " x ");
+ strcpy (pod6.line1, " x ");
+ strcpy (pod6.line2, " + ");
+ strcpy (pod6.line3, " + ");
+ strcpy (pod6.radar, "x");
+
+game_object pod7;
+ pod7.number = 7;
+ pod7.active = 1;
+ pod7.x = 18; //always start on ground
+ pod7.y = rand()%620; //anywhere along the surface
+ pod7.direction = rand()%1000;
+ if(pod7.direction<500){
+ pod7.direction = 4;
+ } else {
+ pod7.direction = 6;
+ };
+ pod7.face = 0;
+ pod7.speed = 1;
+ strcpy (pod7.line0, " x ");
+ strcpy (pod7.line1, " x ");
+ strcpy (pod7.line2, " + ");
+ strcpy (pod7.line3, " + ");
+ strcpy (pod7.radar, "x");
+
+game_object pod8;
+ pod8.number = 8;
+ pod8.active = 1;
+ pod8.x = 18; //always start on ground
+ pod8.y = rand()%620; //anywhere along the surface
+ pod8.direction = rand()%1000;
+ if(pod8.direction<500){
+ pod8.direction = 4;
+ } else {
+ pod8.direction = 6;
+ };
+ pod8.face = 0;
+ pod8.speed = 1;
+ strcpy (pod8.line0, " x ");
+ strcpy (pod8.line1, " x ");
+ strcpy (pod8.line2, " + ");
+ strcpy (pod8.line3, " + ");
+ strcpy (pod8.radar, "x");
+
+game_object pod9;
+ pod9.number = 9;
+ pod9.active = 1;
+ pod9.x = 18; //always start on ground
+ pod9.y = rand()%620; //anywhere along the surface
+ pod9.direction = rand()%1000;
+ if(pod9.direction<500){
+ pod9.direction = 4;
+ } else {
+ pod9.direction = 6;
+ };
+ pod9.face = 0;
+ pod9.speed = 1;
+ strcpy (pod9.line0, " x ");
+ strcpy (pod9.line1, " x ");
+ strcpy (pod9.line2, " + ");
+ strcpy (pod9.line3, " + ");
+ strcpy (pod9.radar, "x");
+
+ game_object pods[8] = { { pod2 }, { pod3 }, { pod4 }, { pod5 }, { pod6 }, { pod7 }, { pod8 }, { pod9 } };
initscr();
player = process_motion(player, player);
pod2 = process_motion(pod2, player);
pod3 = process_motion(pod3, player);
+ pod4 = process_motion(pod4, player);
+ pod5 = process_motion(pod5, player);
+ pod6 = process_motion(pod6, player);
+ pod7 = process_motion(pod7, player);
+ pod8 = process_motion(pod8, player);
+ pod9 = process_motion(pod9, player);
// Draw player object 1
drawlocation = draw_object(player, drawlocation);
// Draw pods objects 2-9
drawlocation = draw_object(pod2, drawlocation);
drawlocation = draw_object(pod3, drawlocation);
+ drawlocation = draw_object(pod4, drawlocation);
+ drawlocation = draw_object(pod5, drawlocation);
+ drawlocation = draw_object(pod6, drawlocation);
+ drawlocation = draw_object(pod7, drawlocation);
+ drawlocation = draw_object(pod8, drawlocation);
+ drawlocation = draw_object(pod9, drawlocation);
// Draw gate object 10
drawlocation = draw_object(gate, drawlocation);
radar_plot(gatebeam3, drawlocation);
radar_plot(pod2, drawlocation);
radar_plot(pod3, drawlocation);
+ radar_plot(pod4, drawlocation);
+ radar_plot(pod5, drawlocation);
+ radar_plot(pod6, drawlocation);
+ radar_plot(pod7, drawlocation);
+ radar_plot(pod8, drawlocation);
+ radar_plot(pod9, drawlocation);
radar_plot(player, drawlocation);
//debug
//check for / process pod pickup
if((pod_in==0)&&(pod2.active==1)){pod_in = pod_check(pod2, player);};
if((pod_in==0)&&(pod3.active==1)){pod_in = pod_check(pod3, player);};
- //for(podloop = 0; podloop == 1; podloop++){
- // if((pod_in==0)&&(pods[podloop].active==1)){pod_in = pod_check(pods[podloop], player);};
- //};
- //if((pod_in==0)&&(pods[0].active==1)){pod_in = pod_check(pods[0], player);};
- //if((pod_in==0)&&(pods[1].active==1)){pod_in = pod_check(pods[1], player);};
+ if((pod_in==0)&&(pod4.active==1)){pod_in = pod_check(pod4, player);};
+ if((pod_in==0)&&(pod5.active==1)){pod_in = pod_check(pod5, player);};
+ if((pod_in==0)&&(pod6.active==1)){pod_in = pod_check(pod6, player);};
+ if((pod_in==0)&&(pod7.active==1)){pod_in = pod_check(pod7, player);};
+ if((pod_in==0)&&(pod8.active==1)){pod_in = pod_check(pod8, player);};
+ if((pod_in==0)&&(pod9.active==1)){pod_in = pod_check(pod9, player);};
+
if(pod_in>0){
strcpy (player.line0, "<==x>");
strcpy (player.line1, "<x==>");
//set pod inactive
if(pod_in==2){pod2 = pod_out(pod2);};
if(pod_in==3){pod3 = pod_out(pod3);};
+ if(pod_in==4){pod4 = pod_out(pod4);};
+ if(pod_in==5){pod5 = pod_out(pod5);};
+ if(pod_in==6){pod6 = pod_out(pod6);};
+ if(pod_in==7){pod7 = pod_out(pod7);};
+ if(pod_in==8){pod8 = pod_out(pod8);};
+ if(pod_in==9){pod9 = pod_out(pod9);};
+
//increment score
score = score + 10;
pod_in = 0;