Final tasks
We only have a few more methods to complete and we have already coded the trickiest bits. The takeShot method having just been passed the player's shot coordinates will compare them to the position of the Sub' and either call draw or boom depending on whether the sub' was hit. We will see how we translate the floating-point coordinates retrieved in onTouchEvent to a position on the grid.
After that, we will code the super-simple boom method which is just a case of increasing the font size, drawing a different color background and then waiting for the player to start another game.
The final bit of coding will be to draw the player's shot on the grid. He can then analyze the last shot compared to the distance and guess at his next shot.
Coding the takeShot method
Let's redo the entire takeShot method because the signature is changing too. Adapt the takeShot method to look like this and then we will analyze the code.
Note
It is probably best to delete it and start again
/* The code...