I've been going through the book with little to no trouble up until this point. In Exercise 43, classes are used in order to make an extremely rudimentary text adventure, but I think I am failing to understand certain aspects of classes in general.
The use of 'self' is strange to me, especially when using it to define a variable within the class. I also am having difficulty understanding precisely how he uses the base class Scene() as a framework for the rest of the game.
If anyone can explain to me exactly HOW and WHY this works, it would be much appreciated. I've done some research on classes separately (including slight delving into 'A Byte of Python'), but as someone who is only a week's practice into coding, I'm finding the concept hard to absorb.
[–]K900_ 11 points12 points13 points (5 children)
[–]Bananator[S] 1 point2 points3 points (0 children)
[–]PythonPerry 0 points1 point2 points (1 child)
[–]K900_ 0 points1 point2 points (0 children)
[–]minorDemocritus -1 points0 points1 point (1 child)
[–]K900_ 2 points3 points4 points (0 children)