Is there any way to import a variable from the main file to another class.
For instance:
# main tab
x = 10
y = 20
def setup():
size(400,400)
def draw():
background(0)
# Ball.py
class Ball:
def myMethod(self):
# here I want to import the 'x or y' variables from the main file.
In Java Processing variables declared in the main tab can be used from everywhere, but when it comes to Python Processing that's not the case.