Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1.     public boolean pushUp(SokobanLogic a){
  2.         SokobanLogic b = a;
  3.         if (b.cL.map[b.cL.yPlayer - 1][b.cL.xPlayer] == '$' &&
  4.                 b.cL.map[b.cL.yPlayer - 2][b.cL.xPlayer] == ' '){
  5.                     b.cL.map[b.cL.yPlayer - 2][b.cL.xPlayer] = '$';
  6.                     b.cL.map[b.cL.yPlayer - 1][b.cL.xPlayer] = '@';
  7.                     return true;
  8.         } else if (b.cL.map[b.cL.yPlayer - 1][b.cL.xPlayer] == '*' &&
  9.             b.cL.map[b.cL.yPlayer - 2][b.cL.xPlayer] == '.' ){
  10.                 b.cL.map[b.cL.yPlayer - 2][b.cL.xPlayer] = '*';
  11.                 b.cL.map[b.cL.yPlayer - 1][b.cL.xPlayer] = '+';
  12.                 return true;
  13.         } else if (b.cL.map[b.cL.yPlayer - 1][b.cL.xPlayer] == '$' &&
  14.             b.cL.map[b.cL.yPlayer - 2][b.cL.xPlayer] == '.' ){
  15.                 b.cL.map[b.cL.yPlayer - 2][b.cL.xPlayer] = '*';
  16.                 b.cL.map[b.cL.yPlayer - 1][b.cL.xPlayer] = '@';
  17.                 return true;
  18.         }
  19.         return false;
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement