"If you want to write the code for player interaction, I will be happy to publish it, otherwise wait for me to do it."
And I write the code for player interaction as a continuation of his
Deflection tutorial. Please read it first if you want to continue with my tutorial addition!
The main task was to add a mouse control so a player can draw lines from which the ball will bounce. After collision between the ball and a line drawn by mouse, that line must be removed!
I think all code is quite well commented so here it is:
In the main function called runMe add the next code immediatelly after the for-loop in which we are checking the walls for collisions:
At the end of the script add this code:
Well, it seems that’s all. Here is the result (try to draw lines with your mouse):