Ace school

with brainly

  • Get help from millions of students
  • Learn from experts with step-by-step explanations
  • Level-up by helping others

A community for students.

Iam working on the final project. Having trouble with draw current shape in Tetris __init__ method. If anyone can help Iam totaly lost. My ramdom shape is returned to self.current_shape but I can't draw it on the tetris board.

MIT 6.189 A Gentle Introduction to Programming Using Python (OCW)
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Join Brainly to access

this expert answer

SIGN UP FOR FREE
post code, and errors, etc.
This is the code to draw shape: self.current_shape.draw(self.win) This is the error message: Traceback (most recent call last): File "C:\Python25\tetris_template.py", line 518, in game = Tetris(win) File "C:\Python25\tetris_template.py", line 434, in __init__ self.current_shape.draw(self.win) File "C:\Python25\tetris_template.py", line 96, in draw block.draw(win) File "C:\Python25\graphics.py", line 363, in draw if canvas_frame.isClosed(): raise GraphicsError, "Can't draw to closed window" File "C:\Python25\lib\lib-tk\Tkinter.py", line 1732, in __getattr__ return getattr(self.tk, attr) AttributeError: isClosed
hmmm stll no idea, we need code examples.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

look at the lines and see where your error is.
Looks to me like your window isn't open.
How do you open the window
It cannot be that hard. I could make a tetris game in Java. I wouldn't give up, keep at it. Window is probably the top level container like a JFrame. Then you put the Canvas like an AWT canvas then the rest of your components go on that. You're also giving up without showing us your code to help you. You expect us to know your issue without meeting us at least half way.
Thanks it wasn't hard. I over think things way to much. THANK YOU MUCH FOR SAYING NOT TO GIVE UP.
it happens, sometimes you burn yourself out and need to put it down for the day/week etc. Sometimes picking up a new project also helps. Giving up on something you spent time on is no fun. glad you fixed it, sorry I wasn't able to help you with the code.. i'm not a python user.

Not the answer you are looking for?

Search for more explanations.

Ask your own question