Computer Science Canada Who Wants to be A Millionaire Game Help |
Author: | imanoob [ Wed Jan 15, 2014 12:46 am ] |
Post subject: | Who Wants to be A Millionaire Game Help |
I have a project for ICS and I am having trouble with my game of Who Wants to Be A Millionaire. (IM A NOOB) What I am having trouble with: Using Help options is mandatory, so I attempted to use the 3 standard options in Who wants to be a millionaire, Call a friend, 50/50, and Ask the Audience. This works to an extent, only the user may only use these options ONCE per game. My Problem: In my program I could not figure out how to make the options disappear once they were used. Preferably once they are used, they say the word "Used" or something along those lines. The output of the help options are done sloppily but i dont mind that. Also, when you click my help options it re-arranges all the answers so that the first one, A, is ALWAYS the correct answer! This is my BIGGEST problem. I would really appreciate any help. My code is attached, Yes it is long BUT THATS ONLY CAUSE THERE ARE 30 questions. i attached it on NOTEPAD. |
Author: | DemonWasp [ Wed Jan 15, 2014 8:53 am ] |
Post subject: | RE:Who Wants to be A Millionaire Game Help |
You'll save yourself a lot of pain if you learn to use arrays and file IO to keep question data separate from your code. What you need to do is change how the buttons are rendered, and remove the click-detection for those options which have been used (or, make clicking them display a "hey, you already used that" message). Unfortunately, you have probably 30-60 instances of this code throughout your program. You should have exactly one. Computers don't forget, so don't bother repeating yourself. You'll notice that repeating yourself leads to buggy behaviour: in several of your questions, you draw duplicate answers. See level9q2 for an example, though there are several. |
Author: | Planet_Fall [ Fri Jan 17, 2014 2:32 pm ] | ||
Post subject: | Re: Who Wants to be A Millionaire Game Help | ||
Found your problem. What the stuff in comments was doing was put the answers in new locations when you just wanted them to stay in the right place. However by how the code is written, by clicking the right answer. It makes it wrong. The only thing I can think of is to make the answer location into a procedure and the Mouse.Where command into a procedure as well. Sorry. ![]()
|