Tuesday, March 22, 2011

Added help text toggle

I added the help information toggle in the Lemonade Stand game; so now you can hit the 'h' key to
turn the help text at the top on and off.

To make this change (within LemonadeGUI.py):

I added self.need_help == True

Line 31 added "K_h"

Line 168 changed "if main.day == 1:" to "if self.need_help == True"

I added this in LemonadeGui.py (lines 288-292):

elif event.key == K_h:
if self.need_help == True:
self.need_help = False
else:
self.need_help = True

I'm working on adding a bar on the bottom to show "Esc to quit" and
"Press h for Help"


Making this change helped me figure out how the "mysterious fix" occurred.
The mysterious fix was a side effect of fixing bug #2. Remember how the
journal always started on day 2? Well, the help text was originally set
up to only show during day 1. Because it was never actually day 1, the
text never showed.

the code in LemonadeGUI.py originally had:
if main.day == 1: (draw the help text)

No comments:

Post a Comment