http://www.daniweb.com/software-development/python/threads/187060/1572491#post1572491
based on a previous thread I would like to know how to replicate the appearance of a house five times on the gasp interface via the script below:
#!/usr/bin/env python
from gasp import * # import everything from the gasp library
begin_graphics(title="Houses At Night", background=color.BLACK) # open the graphics canvas
def draw_house(x, y):
Box((20, 20), 100, 100, filled=True, color=color.BLUE) # the house
Box((55, 20), 30, 50, filled=True, color=color.GREEN) # the door
Box((40, 80), 20, 20, filled=True, color=color.YELLOW) # the left window
Box((80, 80), 20, 20, filled=True, color=color.YELLOW) # the right window
a = (20, 120)
b = (70, 160)
c = (70, 120)
Polygon (([a, b , c]), filled=True, color=color.RED) #Left Roof
d = (70, 160)
e = (120, 120)
f = (70, 120)
Polygon (([d, e, f]), filled=True, color=color.RED) #Right Roof
draw_house(20, 100)
#Box((20 + x, 20 + y), 100 + x, 100 + y)
update_when('key_pressed') # keep the canvas open until a key is pressed
end_graphics() # close the canvas (which would happen
# anyway, since the script ends here, but it
# is better to be explicit).
However I am not too sure how to call the function draw_house() 5 times in order to appear on the screen, any ideas?