Conversation
lw
left a comment
There was a problem hiding this comment.
Thanks for your contribution, and sorry it took me so long to get back to you. I added some comments, I've been a bit picky, do the best you can, don't worry too much. :)
| private static final int SPEED = 12; | ||
|
|
||
| /** | ||
| * Height of the paddle. |
There was a problem hiding this comment.
This is half the height of the paddle.
| * @param player | ||
| */ | ||
| private void computeDestination (Player player) { | ||
| int base; //Unused |
There was a problem hiding this comment.
Nice catch; please remove this variable entirely.
| * @param player Player who's paddle moves. | ||
| * @param destination Destination to move the paddle to. If the destination is further than the speed of the paddle | ||
| * allows, the paddle will travel the furthest distance possible in one frame. | ||
| */private void movePlayer (Player player, int destination) { |
There was a problem hiding this comment.
Add a newline between end of commend and method.
| * Computes the destination of the paddle for the next frame depending on which type of player is moving the | ||
| * current paddle. | ||
| * @param player | ||
| */private void computePosition (Player player) { |
| * current paddle. | ||
| * @param player | ||
| */private void computePosition (Player player) { | ||
| //If the player type is mouse, move the paddle towards the mouse cursor. |
There was a problem hiding this comment.
Add a space at the beginning of the comment. (Applies also to several other comments below).
| // Prepara il campo di gioco | ||
| // If this is the first frame to be rendered. | ||
| if (new_game) { | ||
| //Place the ball in the center of the screen |
There was a problem hiding this comment.
Align properly. (Applies to following comments as well.)
There was a problem hiding this comment.
I think the problem is that you've been using spaces whereas the original code has tabs. Please convert to tabs.
| ball_y = getHeight () / 2; | ||
|
|
||
|
|
||
|
|
Hi there, I wrote documentation for this project as part of a school assignment. I'd be thrilled if you merged it into your project.
Cheers!