Advertisement
Guest User

Untitled

a guest
Mar 13th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. // Funkcia, ktora zisti, ci doslo k zasahu lode na zadanych suradniciach (row,col) hracom s cislom playerID.
  2. int checkHit(int row, int col, int playerID)
  3. {
  4. if(attack_grid[row][col] != 0)
  5. return 0;//Dato polje je neko vec gadjao
  6.  
  7. if(deployment_grid[row][col] == 0)
  8. {
  9. //Promasio je
  10. attack_grid[row][col] = (playerID * -1);
  11. //attack_grid[row][col] -= playerID; Moze i ovako...
  12. return 0;
  13. }
  14. else
  15. {
  16. //Pogodio je
  17. attack_grid[row][col] = playerID;
  18. return 1;
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement