Skip to content

Latest commit

 

History

History
 
 

oop-02-oo-and-pygame

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

OOP 2 - OO Concepts and PyGame

Today

  • Introduction to PyGame through an example program from the PyGame book (McGugan, see below for a reference)
  • Modified to move object around by itself
  • Add other objects
    • Show class diagrams
  • Organize class into a hierarchy
    • Show inheritance in class diagrams
    • Discuss more general process and draw method (including the one following the mouse)

OO-Concepts Covered

  • Show more about relation between class and objects
  • Methods, attributes
  • Inheritance
  • Has-a vs. is-a relationships
  • Abstraction
  • polymorphy

PyGame Concepts Covered

  • Very rough description of events (enough for main loop and exiting the program)
  • Blit
  • Sprite
  • Setting up a screen
  • Tracking the mouse
  • Moving objects around
  • animation/time/frames, frame clock

Resources

UML and class diagrams

UML is a large topic in itself. We will only cover a simplified version with simple diagrams in this course (more on this later).

Source code

The link to the PyGame book's GitHub repository was found from the book's information page: http://www.apress.com/gp/book/9781590598726?wt_mc=ThirdParty.SpringerLink.3.EPR653.About_eBook

Note that the PyGame book uses Python 2, while we are using Python 3 in the course.