Scaled landers, crazies, crawlers.
authorlimb <limb@bc5cbbab-a4ec-0310-bb52-ff3d296db539>
Mon, 8 Jun 2009 15:46:57 +0000 (15:46 +0000)
committerlimb <limb@bc5cbbab-a4ec-0310-bb52-ff3d296db539>
Mon, 8 Jun 2009 15:46:57 +0000 (15:46 +0000)
git-svn-id: svn+ssh://svn/var/repos/curfender@833 bc5cbbab-a4ec-0310-bb52-ff3d296db539

CHANGELOG
main.cpp
motion.cpp

index 261792e..02a929a 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,4 @@
+Landers/crazies and crawlers are scaled as levels increase.
 Landers can change altitude.
 Made laser range more reasonable.
 Added missle powerup, searcheds out landers attacking pods.
index 3146431..12d69f9 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -46,7 +46,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 const int podmax = 8;
 const int bulletmax = 10;
 const int landershotmax = 10;
-const int landermax = 4;
+const int landermax = 12;
 const int crawlermax = 6;
 const int missilemax = 3;
 const float version = 1.0;
@@ -226,7 +226,15 @@ int main(int argc, char *argv[]){
     { 60, 1, rand()%16, rand()%620, 0, 0, 1, 0, 0 },
     { 61, 1, rand()%16, rand()%620, 0, 0, 1, 0, 0 },
     { 62, 1, rand()%16, rand()%620, 0, 0, 1, 0, 0 },
-    { 63, 1, rand()%16, rand()%620, 0, 0, 1, 0, 0 }
+    { 63, 1, rand()%16, rand()%620, 0, 0, 1, 0, 0 },
+    { 64, 0, rand()%16, rand()%620, 0, 0, 1, 0, 0 },
+    { 65, 0, rand()%16, rand()%620, 0, 0, 1, 0, 0 },
+    { 66, 0, rand()%16, rand()%620, 0, 0, 1, 0, 0 },
+    { 67, 0, rand()%16, rand()%620, 0, 0, 1, 0, 0 },
+    { 68, 0, rand()%16, rand()%620, 0, 0, 1, 0, 0 },
+    { 69, 0, rand()%16, rand()%620, 0, 0, 1, 0, 0 },
+    { 70, 0, rand()%16, rand()%620, 0, 0, 1, 0, 0 },
+    { 71, 0, rand()%16, rand()%620, 0, 0, 1, 0, 0 }
   };
   
   for(int landerloop = 0; landerloop<landermax; landerloop++){ 
@@ -266,7 +274,15 @@ int main(int argc, char *argv[]){
     { 90, 0, 0, 0, 6, 0, 1, 0, 0 },
     { 91, 0, 0, 0, 4, 0, 1, 0, 0 },
     { 92, 0, 0, 0, 6, 0, 1, 0, 0 },
-    { 93, 0, 0, 0, 4, 0, 1, 0, 0 }
+    { 93, 0, 0, 0, 4, 0, 1, 0, 0 },
+    { 94, 0, 0, 0, 6, 0, 1, 0, 0 },
+    { 95, 0, 0, 0, 4, 0, 1, 0, 0 },
+    { 96, 0, 0, 0, 6, 0, 1, 0, 0 },
+    { 97, 0, 0, 0, 4, 0, 1, 0, 0 },
+    { 98, 0, 0, 0, 6, 0, 1, 0, 0 },
+    { 99, 0, 0, 0, 4, 0, 1, 0, 0 },
+    { 100, 0, 0, 0, 6, 0, 1, 0, 0 },
+    { 101, 0, 0, 0, 4, 0, 1, 0, 0 }
   };
   
   for(int crazyloop = 0; crazyloop<landermax; crazyloop++){ 
@@ -276,18 +292,18 @@ int main(int argc, char *argv[]){
 
   //shield
   struct game_object shields[12] = {
-    { 100, 1, 0, 0, 5, 0, 1, 0, 0 },
-    { 101, 1, 0, 0, 5, 0, 1, 0, 0 },
-    { 102, 1, 0, 0, 5, 0, 1, 0, 0 },
-    { 103, 1, 0, 0, 5, 0, 1, 0, 0 },
-    { 104, 1, 0, 0, 5, 0, 1, 0, 0 },
-    { 105, 1, 0, 0, 5, 0, 1, 0, 0 },
-    { 106, 1, 0, 0, 5, 0, 1, 0, 0 },
-    { 107, 1, 0, 0, 5, 0, 1, 0, 0 },
-    { 108, 1, 0, 0, 5, 0, 1, 0, 0 },
-    { 109, 1, 0, 0, 5, 0, 1, 0, 0 },
     { 110, 1, 0, 0, 5, 0, 1, 0, 0 },
-    { 111, 1, 0, 0, 5, 0, 1, 0, 0 }
+    { 111, 1, 0, 0, 5, 0, 1, 0, 0 },
+    { 112, 1, 0, 0, 5, 0, 1, 0, 0 },
+    { 113, 1, 0, 0, 5, 0, 1, 0, 0 },
+    { 114, 1, 0, 0, 5, 0, 1, 0, 0 },
+    { 115, 1, 0, 0, 5, 0, 1, 0, 0 },
+    { 116, 1, 0, 0, 5, 0, 1, 0, 0 },
+    { 117, 1, 0, 0, 5, 0, 1, 0, 0 },
+    { 118, 1, 0, 0, 5, 0, 1, 0, 0 },
+    { 119, 1, 0, 0, 5, 0, 1, 0, 0 },
+    { 120, 1, 0, 0, 5, 0, 1, 0, 0 },
+    { 121, 1, 0, 0, 5, 0, 1, 0, 0 }
   };
 
   strcpy (shields[0].line0, "-");
@@ -304,10 +320,10 @@ int main(int argc, char *argv[]){
   strcpy (shields[11].line0, "(");
 
   struct game_object powerups[4] = {
-    { 120, 0, 0, 0, 6, 0, 1, 0, 0 },
-    { 121, 0, 0, 0, 4, 0, 1, 0, 0 },
-    { 122, 0, 0, 0, 6, 0, 1, 0, 0 },
-    { 123, 0, 0, 0, 4, 0, 1, 0, 0 }
+    { 130, 0, 0, 0, 6, 0, 1, 0, 0 },
+    { 131, 0, 0, 0, 4, 0, 1, 0, 0 },
+    { 132, 0, 0, 0, 6, 0, 1, 0, 0 },
+    { 133, 0, 0, 0, 4, 0, 1, 0, 0 }
   };
 
   //Reference loops 200-230
@@ -354,10 +370,10 @@ int main(int argc, char *argv[]){
   struct game_object crawlers[crawlermax] = {
     { 30, 1, 18, rand()%620, 0, 0, 1, 0, 0 },
     { 31, 1, 18, rand()%620, 0, 0, 1, 0, 0 },
-    { 32, 1, 18, rand()%620, 0, 0, 1, 0, 0 },
-    { 33, 1, 18, rand()%620, 0, 0, 1, 0, 0 },
-    { 34, 1, 18, rand()%620, 0, 0, 1, 0, 0 },
-    { 35, 1, 18, rand()%620, 0, 0, 1, 0, 0 }
+    { 32, 0, 18, rand()%620, 0, 0, 1, 0, 0 },
+    { 33, 0, 18, rand()%620, 0, 0, 1, 0, 0 },
+    { 34, 0, 18, rand()%620, 0, 0, 1, 0, 0 },
+    { 35, 0, 18, rand()%620, 0, 0, 1, 0, 0 }
   };
   
   for(int crawlerloop = 0; crawlerloop<crawlermax; crawlerloop++){ 
@@ -781,14 +797,14 @@ int main(int argc, char *argv[]){
     drawlocation = draw_object(gatebeam2, drawlocation);
     drawlocation = draw_object(gatebeam3, drawlocation);
 
-    // Draw landers objects 60-63
+    // Draw landers objects 60-71
     for(int landerloop = 0; landerloop<landermax; landerloop++){ 
       if(landers[landerloop].active==1){ 
        drawlocation = draw_object(landers[landerloop], drawlocation);
       };
     };
     
-    // Draw crazies objects 90-93
+    // Draw crazies objects 90-101
     for(int crazyloop = 0; crazyloop<landermax; crazyloop++){ 
       if(crazies[crazyloop].active==1){ 
        drawlocation = draw_object(crazies[crazyloop], drawlocation);
@@ -1658,13 +1674,25 @@ int main(int argc, char *argv[]){
          //Smart bomb
          if(smartbombs<=3){smartbombs++;};
          //regen landers
-         for(int landerloop = 0; landerloop<landermax; landerloop++){ 
+          int landerlimit;
+          if(level<=4){landerlimit=8;};
+          if(level>4&&level<=12){landerlimit=6;};
+          if(level>12&&level<=16){landerlimit=8;};
+          if(level>16&&level<=20){landerlimit=10;};          
+          if(level>20){landerlimit=12;};                    
+         
+         for(int landerloop = 0; landerloop<landerlimit; landerloop++){ 
            if(landers[landerloop].active==0){
              landers[landerloop] = lander_init(landers[landerloop]);
            };
          };
          //regen crawlers
-         for(int crawlerloop = 0; crawlerloop<crawlermax; crawlerloop++){ 
+         int crawlerlimit;
+          if(level<=8){crawlerlimit=2;};
+          if(level>8&&level<=16){crawlerlimit=4;};
+          if(level>16){crawlerlimit=6;};                    
+         
+         for(int crawlerloop = 0; crawlerloop<crawlerlimit; crawlerloop++){ 
            if(crawlers[crawlerloop].active==0){
              crawlers[crawlerloop] = crawler_init(crawlers[crawlerloop]);
            };
index 544f5bf..1352496 100644 (file)
@@ -77,54 +77,54 @@ game_object process_motion(game_object object, game_object player){
       object.speed=player.speed;
       object.x=player.x;
       object.y=player.y;
-  } else if(object.number>=100&&object.number<=111){
+  } else if(object.number>=110&&object.number<=121){
     object.direction = player.direction;
     object.speed = player.speed;
-    if(object.number==100){
+    if(object.number==110){
       object.x = player.x-1;
       object.y = player.y+1;
     };
-    if(object.number==101){
+    if(object.number==111){
       object.x = player.x-1;
       object.y = player.y+2;
     };
-    if(object.number==102){
+    if(object.number==112){
       object.x = player.x-1;
       object.y = player.y+3;
     };
-    if(object.number==103){
+    if(object.number==113){
       object.x = player.x+1;
       object.y = player.y+1;
     };
-    if(object.number==104){
+    if(object.number==114){
       object.x = player.x+1;
       object.y = player.y+2;
     };
-    if(object.number==105){
+    if(object.number==115){
       object.x = player.x+1;
       object.y = player.y+3;
     };
-    if(object.number==106){
+    if(object.number==116){
       object.x = player.x-1;
       object.y = player.y;
     };
-    if(object.number==107){
+    if(object.number==117){
       object.x = player.x+1;
       object.y = player.y+4;
     };
-    if(object.number==108){
+    if(object.number==118){
       object.x = player.x-1;
       object.y = player.y+4;
     };
-    if(object.number==109){
+    if(object.number==119){
       object.x = player.x+1;
       object.y = player.y;
     };
-    if(object.number==110){
+    if(object.number==120){
       object.x = player.x;
       object.y = player.y+5;
     };
-    if(object.number==111){
+    if(object.number==121){
       object.x = player.x;
       object.y = player.y-1;
     };