874Part VCase (Web design rates) StudiesFinally, Figure 46-3 shows Game Over,
874Part VCase StudiesFinally, Figure 46-3 shows Game Over, complete with taunting message and a list of highscorers. (There s a corresponding Game Won screen in the unlikely event that the user survived all the questions the game could come up with.) Figure 46-3:Game overThe rulesThe basic play cycle is simple: The player is asked a question that requires a numerical answer, and the player responds by choosing a range of values that should include the answer. The goalis to answer as many questions correctly as possible, while surviving in the meantime. Survivaldepends on credit, which is accumulated by answering questions correctly with a narrow rangeand is spent by giving wrong answers or answering questions too broadly. The exact rewards and penalties are easily tweakable in the code, but in this chapter s versionthey are: .Correct answers:One point added to credit, minus a penalty for the size of the rangespecified. The penalty ranges from zero for answers that use only one step of the possi- ble range, up to four points for making the range as wide as possible. .Incorrect answers:Four points deducted from credit. Credit starts at five points and can rise only as high as fifteen points. The game is over whencredit goes below zero. It is easy to pass by simply submitting your answer without making a choice, since the radiobuttons are set to specify the widest possible answer range unless the player changes them. The penalties are set up so that passing is costly (a total of 1 - 4 = -3 points), but not as costly52
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.