top of page

Abstraction Example
​


The right image shows the paddle.draw() function, which creates the paddle and controls its mechanics. The left image shows where the paddle.draw() function is called in the main loop of our code. Abstraction makes the execution of this command very easy. Because this function repeats over and over again infinitely, abstraction reduces the lines of code to execute this function down to one, as shown in the left image.
bottom of page