Mar-24-2020, 05:14 PM
Hi, I do understand a fair amount about object oriented programming. But the following convention using dot notation eludes me.
Although the following code snippet is written using pygame I believe that that question that I have concerns python, specifically.
It would appear to me, and I am just guessing, that rect is declared as an object in the first line. That would mean, if correct, that "move" used in the second line would be a method declared in the "rect" class. Somewhere.
Am I close?
Thank You
Tom
Although the following code snippet is written using pygame I believe that that question that I have concerns python, specifically.
rect = surface1.get_rect() rect = rect.move("some position here", "another position here" )It is on the second line that I am confused. rect is declared on the first line. Then rect.move is used on the second line.
It would appear to me, and I am just guessing, that rect is declared as an object in the first line. That would mean, if correct, that "move" used in the second line would be a method declared in the "rect" class. Somewhere.
Am I close?
Thank You
Tom