Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

edjuradob

  • 3 years ago

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

  • This Question is Closed
  1. edjuradob
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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)

  2. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy