Guest User

Untitled

a guest
Jan 5th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -(int)getTopRightCorner
  2. {
  3.     id board = [[GameManager sharedGameManager] board];
  4.     int toprow = [board topRow];
  5.  
  6.    
  7.     int gridWidth = boardGridX;
  8.     int gridHeight = boardGridY;
  9.     int overthetop = toprow * gridWidth + (gridWidth-1); // this should get us the toprow, rightcorner
  10.    
  11.     int toprightcorner = gridWidth * (gridHeight+1) - 1; //since we start from 0, need to remove one, had 2 bonus rows, using only one now
  12.     //if not inside map
  13.     while(toprightcorner > overthetop) {
  14.         NSLog(@"looking lower");
  15.         toprightcorner -= gridWidth;
  16.     }
  17.    
  18.     if (toprightcorner < 0) {
  19.         toprightcorner = -1;
  20.     }
  21.    
  22.     return toprightcorner;
  23. }
Add Comment
Please, Sign In to add comment