Advertisement
lukibeni

Untitled

Jun 11th, 2015
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. public int[] hovaLehet(int x, int y, VilagDef.TJatekos jatekos) {
  2. boolean megvan = false;
  3. for (int i = 0; i < 10; i++) {
  4. for (int j = 0; j < 10; j++) {
  5. if (x >= 0 && x < 100 && y >= 0 && y < 100) {
  6. if (jatekos.Vilag[y+i][x+j].Objektum == VilagDef.cvMezo && jatekos.Vilag[y][x+j].Objektum == VilagDef.cvMezo && jatekos.Vilag[y+i][x].Objektum == VilagDef.cvMezo &&
  7. jatekos.Vilag[y-i][x-j].Objektum == VilagDef.cvMezo && jatekos.Vilag[y][x-j].Objektum == VilagDef.cvMezo && jatekos.Vilag[y-i][x].Objektum == VilagDef.cvMezo &&
  8. jatekos.Vilag[y-i][x+j].Objektum == VilagDef.cvMezo && jatekos.Vilag[y+i][x-j].Objektum == VilagDef.cvMezo) {
  9. return new int[]{x,y};
  10. }
  11.  
  12. }
  13. }
  14. }
  15.  
  16. return null;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement