Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Funkcia, ktora zisti, ci doslo k zasahu lode na zadanych suradniciach (row,col) hracom s cislom playerID.
- int checkHit(int row, int col, int playerID)
- {
- if(attack_grid[row][col] != 0)
- return 0;//Dato polje je neko vec gadjao
- if(deployment_grid[row][col] == 0)
- {
- //Promasio je
- attack_grid[row][col] = (playerID * -1);
- //attack_grid[row][col] -= playerID; Moze i ovako...
- return 0;
- }
- else
- {
- //Pogodio je
- attack_grid[row][col] = playerID;
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement