A community for students. Sign up today!
Here's the question you clicked on:
 0 viewing
 2 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
 2 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

edjuradob
 2 years ago
Best ResponseYou've already chosen the best response.0i'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)
Ask your own question
Ask a QuestionFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.