/[projectaxis]/projectaxis/projectAxis/src/blotchmaker/movetest.cpp
ViewVC logotype

Diff of /projectaxis/projectAxis/src/blotchmaker/movetest.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by leiavoia, Sun Jun 1 04:03:56 2003 UTC revision 1.2 by leiavoia, Wed Jun 4 03:16:01 2003 UTC
# Line 17  from A to B using the best possible rout Line 17  from A to B using the best possible rout
17  #include "blotchmaker.h"  #include "blotchmaker.h"
18  #include "map.h"  #include "map.h"
19  #include "../pods/pod.h"  #include "../pods/pod.h"
20    #include "../pods/missions.h"
21    
22  #include <iostream>  #include <iostream>
23  #include <stdio.h>  #include <stdio.h>
# Line 46  srand(time(NULL)); Line 47  srand(time(NULL));
47  // MAKE THE MAP  // MAKE THE MAP
48    
49  //Map* map;  //Map* map;
50  map = new Map(20,20);  map = new Map(15,15);
51    
52  //Blotchmaker* blotchmaker;  //Blotchmaker* blotchmaker;
53  blotchmaker = new Blotchmaker(*map);  blotchmaker = new Blotchmaker(*map);
# Line 56  blotchmaker = new Blotchmaker(*map); Line 57  blotchmaker = new Blotchmaker(*map);
57    
58  // Group vars:  // Group vars:
59  blotchmaker->SetHBSize(1);  blotchmaker->SetHBSize(1);
60  blotchmaker->SetMaxBlotches(6);  blotchmaker->SetMaxBlotches(4);
61  blotchmaker->SetTypeChances(1);  blotchmaker->SetTypeChances(1);
62    
63  // SLOT 0  // SLOT 0
# Line 84  if (!good) { Line 85  if (!good) {
85    
86  // set map pointer for all pods:  // set map pointer for all pods:
87  Pod::SetMapPointer(*map);  Pod::SetMapPointer(*map);
88    Mission::SetMapPointer(*map);
89    
90  // set Quarterback  // set Quarterback
91  Pod a_pod(0);  Pod a_pod(0);
92  map->SetOccu(0,0,a_pod);  a_pod.Place(14,14);
93    a_pod.SetAvoid(6);
94    
95  // set opponants  // set opponants
96  Pod another_pod(1);  Pod another_pod(1);
97  map->SetOccu(0,5,another_pod);  another_pod.Place(7,1);
98    another_pod.SetMission(PATROL);
99    
100  Pod another_pod2(1);  Pod another_pod2(1);
101  map->SetOccu(3,5,another_pod2);  another_pod2.Place(8,8);
102    another_pod2.SetMission(PATROL);
103    
104    
105  Pod another_pod3(1);  Pod another_pod3(1);
106  map->SetOccu(6,5,another_pod3);  another_pod3.Place(10,5);
107    another_pod3.SetMission(PATROL);
108    
109    
110  map->PrintToScreen();  map->PrintToScreen();
111    
112    
113  while(1) {  for(int i=0; i<10; i++) {
114    
115            if (a_pod.CreatePath(a_pod.GetXPos(), a_pod.GetYPos(), 0,0) == 0) {cout << "[" <<a_pod.GetName() << "]: No Path - try again" << endl; }
116            else {a_pod.Walk();}
117    
118            another_pod.Misn()->Exe();
119            another_pod2.Misn()->Exe();
120            another_pod3.Misn()->Exe();
121    
122    
         if (!a_pod.CreatePath( a_pod.GetXPos(), a_pod.GetYPos(),0,19)) { // keep going to the same place  
                 cout << "NO PATH - TRY AGAIN\n";  
                 return 1;  
                 }  
   
         char opt;  
         cout << "Walk? [Y/N]" << endl;  
         cin >> opt;  
         switch(opt) {  
                 case 'Y':  
                         a_pod.Walk();  
                         break;  
                 case 'y':  
                         a_pod.Walk();  
                         break;  
                 default:  
                         return 0;  
                 }  
123          }          }
124    
125    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26