Classes with Geometries

def setup():
global img, howdy
size(620,240)
#rename image to match your image name in your data folder
img = loadImage("location-2-0.jpg")
image(img,0,0)
class Window(object):

def __init__(self, x, y, windowWidth, windowHeight, bar):
self.x = x
self.y = y
self.windowWidth = windowWidth/2
self.windowHeight = windowHeight/2
self.bar = bar

def area(self):
return self.windowWidth * self.windowHeight

img = loadImage("location-9-0.jpeg")

def draw(self):
if self.x < mouseX and mouseX < self.x + self.windowWidth:
fill(0,0,255)
triangle(self.x + 20,self.y + 15,20,20,20,200)
stroke(255, 255, 255)

else:
fill(self.bar)
loadImage("location-9-0.jpeg")
rect(self.x, self.y, self.windowWidth, self.windowHeight)
rect(self.x, self.y, self.windowWidth, self.windowHeight)
def setup():
size(800, 450)

global window_1
window_1 = Window(10, 10, 12, 30, color(128, 128, 128))

print window_1.windowWidth
print window_1.area()

global img

global buildingWindows
buildingWindows = []

for w in xrange(5, 200, 5):
window = Window(w * 13, 0, w, 450, color(0, 128, 128))
buildingWindows.append(window)

def draw():
img = loadImage("location-9-0.jpeg")
#image(img,0,0)
background(0)

for window in buildingWindows:
window.draw()
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.