home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / games / btlblips / btlblips.txt < prev   
Text File  |  1990-10-27  |  5KB  |  131 lines

  1. It has come to my attention that Battle Blips becomes confused under
  2. certain circumstances. Sometimes when playing the computer, it will
  3. bounce the cursor from one side of the playing grid to the other,
  4. never making a shot nor releasing control of the computer. To
  5. eliminate this confusion, it is necessary to modify procedure
  6. 'rand_pick' and move procedure 'get_next_hit' so 'rand_pick' can call
  7. it. This is all it takes to make the new, improved Battle Blips
  8. version 1.6.
  9.  
  10. The page numbers below refer to the page of ST Log, July '88, issue 21,
  11. that the source code referenced can be found.
  12.  
  13. To modify bbltlips.pas 1.5 into 1.6 :
  14.  
  15.     goto line 309, col 46 -- change '1.5' to '1.6'
  16.          (page 60)
  17.  
  18.     goto line 1188 -- move entire procedure 'get_next_hit' (14 lines) to
  19.          (page 68)    line 1156, putting it before procedure 'rand_pick'.
  20.                       (rand_pick will be modified to call 'get_next_hit')
  21.  
  22.     goto line 1189 -- should be 'ctr := ctr+1 ;'. The next line will be
  23.          (page 68)    'x_inc := 0 ;'.  Between those two lines insert the
  24.                       following code block as is:
  25.  
  26. (* BEGINNING OF CODE BLOCK *)
  27.             IF (ctr > 3) THEN BEGIN         { indicates an unresolved hit }
  28.                                             {  surrounded by tested squares }
  29.                                             {  so seek next hit and work from }
  30.                                             {  there... }
  31.                 col := col + inc;
  32.                 IF(col < 0) OR (col > 9) THEN BEGIN
  33.                     col := start_xy;
  34.                     row := row + inc;
  35.                     IF(row < 0) OR (row > 9) THEN
  36.                         row := start_xy;
  37.                 END;
  38.                 get_next_hit( col, row);    { seek next hit, must be more to }
  39.                                             {  be here }
  40.                 x := col ;                  { untried uses globals }
  41.                 y := row ;                  {  x and y... }
  42.                 ctr := 0;                   { reset counter }
  43.             END ;
  44.  
  45. (* END OF CODE BLOCK *)
  46.  
  47. Listed below is the entire procedure 'rand_pick' with the above
  48. modification:
  49.  
  50.     PROCEDURE rand_pick( col, row : Integer ) ;
  51.     VAR ctr, ctr2, direction : Integer ;
  52.         srch_pattern, temp : Array[ 0..3 ] OF Integer ;
  53.  
  54.     BEGIN { rand_pick }
  55.         FOR ctr := LOOK_LEFT TO LOOK_DOWN DO
  56.             temp[ctr] := ctr ;
  57.         FOR ctr := LOOK_DOWN DOWNTO LOOK_LEFT DO BEGIN
  58.             direction := rand( ctr+1 ) ;
  59.             srch_pattern[ ctr ] := temp[ direction ] ;
  60.             FOR ctr2 := direction TO LOOK_UP DO
  61.                 temp[ctr2] := temp[ctr2 + 1] ;
  62.         END ;
  63.         x := col ;
  64.         y := row ;
  65.         ctr := -1 ;
  66.         REPEAT
  67.             ctr := ctr+1 ;
  68.             IF (ctr > 3) THEN BEGIN         { indicates an unresolved hit }
  69.                                             {  surrounded by tested squares }
  70.                                             {  so seek next hit and work from }
  71.                                             {  there... }
  72.                 col := col + inc;
  73.                 IF(col < 0) OR (col > 9) THEN BEGIN
  74.                     col := start_xy;
  75.                     row := row + inc;
  76.                     IF(row < 0) OR (row > 9) THEN
  77.                         row := start_xy;
  78.                 END;
  79.                 get_next_hit( col, row);    { seek next hit, must be more to }
  80.                                             {  be here }
  81.                 x := col ;                  { untried uses globals }
  82.                 y := row ;                  {  x and y... }
  83.                 ctr := 0;                   { reset counter }
  84.             END ;
  85.             x_inc := 0 ;
  86.             y_inc := 0 ;
  87.             CASE srch_pattern[ ctr ] OF
  88.                 LOOK_LEFT  : x_inc := -1 ;
  89.                 LOOK_RIGHT : x_inc :=  1 ;
  90.                 LOOK_UP    : y_inc := -1 ;
  91.                 LOOK_DOWN  : y_inc :=  1 ;
  92.             END ; { case }
  93.         UNTIL ( untried( x_inc, y_inc, -1 ) >= shortest ) AND
  94.               ( untried( x_inc, y_inc, 0 ) > 1 ) ;
  95.         x := x + x_inc ;
  96.         y := y + y_inc ;
  97.     END ; { rand_pick }
  98.  
  99.  
  100.     goto line 1257 -- look for these lines in procedure 'next_hit':
  101.          (page 68)
  102.                             row2 := row2 - inc ;
  103.                             done := ( row2 < 0 ) OR ( row2 > 9 ) ;
  104.  
  105.                       now insert this line:
  106.  
  107.                             reverse := TRUE;
  108.  
  109.                       before the line:
  110.  
  111.                             IF NOT done THEN BEGIN
  112.  
  113.  
  114.     goto line 1284 -- look for these lines in procedure 'next_hit':
  115.          (pages 68-69)
  116.                             col2 := col2 - inc ;
  117.                             done := ( col2 < 0 ) OR ( col2 > 9 ) ;
  118.  
  119.                       now insert this line:
  120.  
  121.                             reverse := TRUE;
  122.  
  123.                       before the line:
  124.  
  125.                             IF NOT done THEN BEGIN
  126.  
  127. Sorry for any inconvenience...
  128.  
  129.         --Patrick Dell'Era
  130.           06-30-88
  131.