Topic: help me in gasp!

Hi all ,

Can you please help me to find out the problem , this is my program :



from gasp import * # import everything from the gasp library
def draw_house(x,y):
#begin_graphics(width=800, height=600, title="House At Night", background=color.BLACK)

#Box((x+35, y), 30, 50,color=color.GREEN,filled=True) # the door
Box((x,y), 100,100,color=color.BLUE,filled=True,thickness=1) # the house
Box((x+35, y), 30, 50,color=color.GREEN,filled=True) # the door
Box((x+10,y+60), 20, 20,color=color.YELLOW,filled=True) # the left window
Box((x+70,y+60), 20, 20,color=color.YELLOW,filled=True) # the right window
Polygon(((x, y+100),(x+50,y+140),(x+100,y+100)),filled=True,color=color.RED)

#Line((20, 120), (70, 160)) # the left roof
#Line((70, 160), (120, 120)) # the right roof
#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 i
# is better to be explicit).

begin_graphics(height=460, width=560, title='Houses at Night',
background=color.BLACK)

draw_house(20,20)
draw_house(230,20)
draw_house(440,20)
draw_house(125,160)
draw_house(335,160)
draw_house(230,300)

update_when('key_pressed')
end_graphics()



When i run the program , the houses don't appear fully if i call the function more than one , but separately it works fine !



Thanks.

Last edited by newp (September 27, 2010 19:04)

Thumbs up