13.5 Summary
In this chapter, we extended our discussion of object-oriented programming by introducing event-driven programming. We used multithreaded event-driven programming to implement a simple video game. We designed our video game by creating classes to represent the components of the game. Functions were tied to mouse clicks and keys presses so that actions would occur when those input events took place. We used timers to place the video game in motion. As part of the implementation, we used inheritance in building turtle objects used in the game. In addition, we used a static variable that could be shared by each object of the class. We also created a static method that did not belong to any object of the class, but could access static ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access