• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with graphics of my hangman game  RSS feed

 
Katy Lee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having some problems with the graphics of my hangman game. The graphic that's supposed to show up on the first guess (the hangman pole) doesn't show up until guess number 2. And on the eighth guess, no graphics show up (I just get a blank frame). I'm not sure how to fix this

Any help/ideas are appreciated!

 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

There must be a more elegant way to draw a gallows than all those if-elses.
One possibility:- Put the parts of the gallows into an array and every time there is a wrong guess, choose the next array element.
 
Katy Lee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply! Unfortunately, this code was provided to us by the instructor and he wants us to keep most of it the same. He just wants us to change the graphics. It's interesting, when I ran the program that he gave us, which only uses "drawLine" and such, everything was fine. But once I put in my JPEG images, it didn't work.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!