Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

lh4219

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.

  • one year ago
  • one year ago

  • This Question is Closed
  1. KonradZuse
    Best Response
    You've already chosen the best response.
    Medals 1

    post code, and errors, etc.

    • one year ago
  2. lh4219
    Best Response
    You've already chosen the best response.
    Medals 0

    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 <module> 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

    • one year ago
  3. KonradZuse
    Best Response
    You've already chosen the best response.
    Medals 1

    hmmm stll no idea, we need code examples.

    • one year ago
  4. KonradZuse
    Best Response
    You've already chosen the best response.
    Medals 1

    look at the lines and see where your error is.

    • one year ago
  5. rsmith6559
    Best Response
    You've already chosen the best response.
    Medals 0

    Looks to me like your window isn't open.

    • one year ago
  6. lh4219
    Best Response
    You've already chosen the best response.
    Medals 0

    How do you open the window

    • one year ago
  7. KonradZuse
    Best Response
    You've already chosen the best response.
    Medals 1

    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.

    • one year ago
  8. lh4219
    Best Response
    You've already chosen the best response.
    Medals 0

    Thanks it wasn't hard. I over think things way to much. THANK YOU MUCH FOR SAYING NOT TO GIVE UP.

    • one year ago
  9. KonradZuse
    Best Response
    You've already chosen the best response.
    Medals 1

    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.

    • one year ago
    • Attachments:

See more questions >>>

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
  • 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.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.