I'm having trouble with the tetrominoes. I have created all of the shapes and i can draw all of them separatelly, but when i try to draw 2 or more, i get the following error: GraphicsError: Object currently drawn i've tried with the for loop given in the example and also i've tried this: new_win=GraphWin('Tetrominoes',900,150) tetrominoes=[I_Shape,J_Shape,L_Shape,O_Shape,S_Shape,T_Shape,Z_Shape] x=3 shape=I_Shape(Point(x,1)) shape2=J_Shape(Point(x+4,4)) shape2.draw(new_win) shape.draw(new_win) new_win.mainloop() and i keep getting the same error. Help please
i've made it work, i can't use the same window twice, so, first have to define all the shapes and then draw them in the window. The code in the example doesn't work: for tetromino in tetrominoes: shape = tetromino(Point(x, 1)) shape.draw(win) x += 4 i made it work with the following changes: for tetromino in tetrominoes: shape=tetromino(Point(x,1)) print tetromino x+=4 shape.draw(new_win)
Join our real-time social learning platform and learn together with your friends!