snake
view main.py @ 177:cd67dc65f599
Removed rules to keep near walls from e2
author | Daniil Alexeyevsky <me.dendik@gmail.com> |
---|---|
date | Sun, 26 Dec 2010 12:12:44 +0300 |
parents | 55aeb245c503 |
children | e967a9b10fce |
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."""
87 return
95 """Run the game with 'step_length' ms step
96 After the end of the game - restarts it with snakes survived in
97 previous game"""
100 return
102 return
106 return
109 """Do the next game step"""
111 return
118 pass
121 pass
122 return
125 """Stops runnin of the game"""
131 """Check the number of snakes alive.
132 End the game if alive snake number is less than two."""
137 pass
143 """"Restarts snakes positions after the end of the game
145 Options:
146 survived = "yes" - restarts next round only with snakes survived in previous round
147 survived = "no" - restart next roun with all snakes played in previous round"""
161 """End the game and raise the window that tels about it."""
168 pass