It kind of blows my mind that you could remember not only the person involved in the topic from four years ago but the exact topic in question.
Whenever I ask for help, I try to dig into the examples so I can understand how the end result was reached instead of just copying the code. I struggled with math in school, so I have some questions.
So, when the game starts, we start at the left side at x = 1 since the loop index starts there (or at 0, we start on the left side, is what it is). We use... uuh some graphing equation (math that I didn't do well on) to create a sine wave that doesn't go below a certian y value. This gives us our "surface" pixel. Then our width is 1 since we are building 1 line at a time from the left, and we do the entire height possible of the screen downwards. If we went down below the earth, we'd see the exact sine wave as the top of the earth on the bottom side 640 pixels down, right?
I'm a bit behind on the erasing code... I can tell both radius and dx are important here. In this instance, we use radius to set DX in order to get the erase code... so each shot that my students program would edit radius to determine the digging power of the shot.
So... we take both a negative value of whatever the radius is and a positive value of the radius to build essentially a "diameter" of how big the hole is going to be with a range of values. So with -50 and 50, we have 100 loops of this code. Every time we repeat the code, we shave off a ring of the attacked area from... the outside in? I'm basically guessing. This is why I went to summer school for math, haha.