snake
view main.py @ 173:008be193a0a3
fixed not correct work of UI.restart() if whole game was made by steps
author | Alex Martynov |
---|---|
date | Fri, 24 Dec 2010 00:50:06 +0300 |
parents | 4a3ae22734b0 |
children | 55aeb245c503 |
line source
9 """User Interface:
11 Atributes:
13 - 'root' - root Window game placed at
14 - 'engine' - engine of the game
15 - 'canvas' - Widget field is pictured at
16 - 'step_id' - current step of the game
17 - 'after_id' - identificator of runing game process
18 - 'step_legth' - length of the step (in ms)
19 - 'game_length' - number of the steps in one round of the game"""
21 """Create Python Battle game window.
22 Initialyze engige of the game."""
33 return
36 """Packing the buttons in root frame.
37 Definition of button functions.
39 'Load' - ask for snake file load
40 'Run' - runs the game/next round. Next round starts with snakes survived in previous
41 'Step' - do the next dtep of the game
42 'End' - manual end of the game
43 'Restart" - restart the field with snakes of previous round"""
66 """Ask for snake file loading.
67 Initialyzing snake and draw it on the field.
68 Return field back to default (without snakes) after end of the game."""
72 pass
76 return
79 pass
82 return
85 """Init running of the game."""
92 """Run the game with 'step_length' ms step
93 After the end of the game - restarts it with snakes survived in
94 previous game"""
97 return
99 return
103 return
106 """Do the next game step"""
108 return
114 pass
117 pass
120 pass
121 return
124 """Check the number of snakes alive.
125 End the game if alive snake number is less than two."""
130 pass
136 """"Restarts snakes positions after the end of the game
138 Options:
139 survived = "yes" - restarts next round only with snakes survived in previous round
140 survived = "no" - restart next roun with all snakes played in previous round"""
154 """End the game and raise the window that tels about it."""
157 pass
163 pass