• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 16. Pinball > Game Code

Game Code

Pinball uses a lot of code you've already seen in earlier chapters. The game requires frame-independent collision detection for ball-ball and ball-line collisions, and employs the appropriate collision-reaction code for both of these. The bulk of the code you haven't yet seen, and may not be able to easily understand at first glance, is the code that handles the following functions:

  • Creating the table geography in memory—specifically, the angled lines (including the flippers)

  • Detecting if a collision has occurred between the ball and a flipper at the instant a flipper is flipped


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint