Mercurial > rinkhals
annotate gamelib/helpscreen.py @ 369:25f7d4824250
Disable timers during move_foxes loop to stop events piling up too much
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Thu, 10 Sep 2009 15:18:39 +0000 |
parents | cdfeef53d6f1 |
children | 2bcfccb8288e |
rev | line source |
---|---|
179 | 1 """Help screen.""" |
2 | |
3 from pgu import gui | |
4 import pygame | |
5 import constants | |
6 import engine | |
7 import imagecache | |
8 | |
9 HELP="""Welcome to %s | |
10 | |
11 Introduction: | |
12 | |
13 The aim of the game is to make as much money as possible from your chicken | |
14 farm. The problem is the foxes, which want to eat your chickens. Since hiring | |
15 guards is both too expensive and unreliable, the obvious solution is to help | |
16 the chickens defend themselves. | |
17 | |
18 Game mechanics: | |
19 | |
20 You lose if you end a night with no chickens left. | |
21 | |
309
cdfeef53d6f1
cosmetic string change
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
308
diff
changeset
|
22 Depending on the game length you select, you win if you survive for two weeks, |
cdfeef53d6f1
cosmetic string change
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
308
diff
changeset
|
23 three months or until you have chopped down all the trees in the forest and |
cdfeef53d6f1
cosmetic string change
Adrianna Pińska <adrianna.pinska@gmail.com>
parents:
308
diff
changeset
|
24 caused the complete extinction of the fox population. |
179 | 25 |
26 Chickens only lay eggs in henhouses, and must stay on the egg for 2 days to | |
230
fa0e818c3fee
Update instructions to match new chick hatching behaviour.
Simon Cross <hodgestar@gmail.com>
parents:
181
diff
changeset
|
27 hatch a new chicken. Chickens that hatch in already full henhouses are |
fa0e818c3fee
Update instructions to match new chick hatching behaviour.
Simon Cross <hodgestar@gmail.com>
parents:
181
diff
changeset
|
28 moved to just outside. If there is no space outside, they die immediately |
fa0e818c3fee
Update instructions to match new chick hatching behaviour.
Simon Cross <hodgestar@gmail.com>
parents:
181
diff
changeset
|
29 from overcrowding. |
179 | 30 """ % constants.NAME |
31 | |
32 def make_help_screen(): | |
33 """Create a main menu""" | |
34 help_screen = HelpScreen(width=600) | |
35 | |
36 c = HelpContainer(align=0, valign=0) | |
37 c.add(help_screen, 0, 0) | |
38 | |
39 return c | |
40 | |
41 class HelpContainer(gui.Container): | |
42 def paint(self, s): | |
43 pygame.display.set_caption('Instructions') | |
181
7e556ef40100
Lighten help screen. Fix some oddities in darken modifier.
Simon Cross <hodgestar@gmail.com>
parents:
179
diff
changeset
|
44 splash = imagecache.load_image("images/splash.png", ["lighten_most"]) |
179 | 45 pygame.display.get_surface().blit(splash, (0, 0)) |
46 gui.Container.paint(self, s) | |
47 | |
48 class HelpScreen(gui.Document): | |
49 def __init__(self, **params): | |
50 gui.Document.__init__(self, **params) | |
51 | |
52 def done_pressed(): | |
53 pygame.event.post(engine.GO_MAIN_MENU) | |
54 | |
55 done_button = gui.Button("Return to Main Menu") | |
56 done_button.connect(gui.CLICK, done_pressed) | |
57 | |
58 space = self.style.font.size(" ") | |
59 | |
60 for paragraph in HELP.split('\n\n'): | |
61 self.block(align=-1) | |
62 for word in paragraph.split(): | |
63 self.add(gui.Label(word)) | |
64 self.space(space) | |
65 self.br(space[1]) | |
66 self.br(space[1]) | |
67 self.block(align=0) | |
68 self.add(done_button, align=0) |