Unlike in Processing tabs that exist in the same folder, different Python modules in the same directory does not share width and height information. width and height have to be imported to the Class constructor for now as a workaround.
Example:
noc-2-mewnala-port > chapter2 > Example_2_6_Attraction
width and height are declared in Example_2_6_Attraction.py setup
Attractor.py and Mover.py are also trying to access width and height
Note that there is no error anyway if we try to run the sketch without providing width and height to the Classes, but it isn't exposed to modules outside the one that has size(width, height) in the setup
Unlike in Processing tabs that exist in the same folder, different Python modules in the same directory does not share
widthandheightinformation.widthandheighthave to be imported to the Class constructor for now as a workaround.Example:
noc-2-mewnala-port>chapter2>Example_2_6_Attractionwidthandheightare declared inExample_2_6_Attraction.pysetupAttractor.pyandMover.pyare also trying to accesswidthandheightNote that there is no error anyway if we try to run the sketch without providing
widthandheightto the Classes, but it isn't exposed to modules outside the one that hassize(width, height)in thesetup