snake
view main.py @ 169:4eec473f445b
added button work explanation in documentation.
author | Alex Martynov |
---|---|
date | Thu, 23 Dec 2010 20:37:13 +0300 |
parents | 0f7df983d610 |
children | 4a3ae22734b0 |
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."""
89 return
94 """Run the game with 'step_length' ms step
95 After the end of the game - restarts it with snakes survived in
96 previous game"""
99 return
103 return
106 """Do the next game step"""
108 return
112 pass
115 pass
118 pass
119 return
122 """Check the number of snakes alive.
123 End the game if alive snake number is less than two."""
128 pass
134 """"Restarts snakes positions after the end of the game
136 Options:
137 survived = "yes" - restarts next round only with snakes survived in previous round
138 survived = "no" - restart next roun with all snakes played in previous round"""
152 """End the game and raise the window that tels about it."""
155 pass
161 pass