Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean pushUp(SokobanLogic a){
- SokobanLogic b = a;
- if (b.cL.map[b.cL.yPlayer - 1][b.cL.xPlayer] == '$' &&
- b.cL.map[b.cL.yPlayer - 2][b.cL.xPlayer] == ' '){
- b.cL.map[b.cL.yPlayer - 2][b.cL.xPlayer] = '$';
- b.cL.map[b.cL.yPlayer - 1][b.cL.xPlayer] = '@';
- return true;
- } else if (b.cL.map[b.cL.yPlayer - 1][b.cL.xPlayer] == '*' &&
- b.cL.map[b.cL.yPlayer - 2][b.cL.xPlayer] == '.' ){
- b.cL.map[b.cL.yPlayer - 2][b.cL.xPlayer] = '*';
- b.cL.map[b.cL.yPlayer - 1][b.cL.xPlayer] = '+';
- return true;
- } else if (b.cL.map[b.cL.yPlayer - 1][b.cL.xPlayer] == '$' &&
- b.cL.map[b.cL.yPlayer - 2][b.cL.xPlayer] == '.' ){
- b.cL.map[b.cL.yPlayer - 2][b.cL.xPlayer] = '*';
- b.cL.map[b.cL.yPlayer - 1][b.cL.xPlayer] = '@';
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement