斯坦福大学公开课 编程方法学 Breakout 解题思路
1、The Breakout game
After all the bricks in a particularcolumn have been cleared, a path will open to the top wall. When this situationoccurs, the ball will often bounce back and forth several times between the topwall and the upper line of bricks without the user ever having to worry abouthitting the ball with the paddle. This condition is called “breaking out” andgives meaning to the name of the game. The diagram on the right shows thesituation shortly after the first ball has broken through the wall. That ballwill go on to clear several more bricks before it comes back down an openchannel.
3、bounce off the walls
4、Checking for collisions
Remove bricks when coordinates coincide.