Changeset 176:e967a9b10fce
- Timestamp:
- 12/26/10 06:55:47 (5 years ago)
- Branch:
- default
- Children:
- 178:586633c26679, 179:d73d8cecc812
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main.py
r175 r176 љ 159 159 љ 160 160 def end (self):љ 161 љ """End the game and raise the windowthat tels about it."""љљ 161 """End the round and raise the label that tels about it."""љ 162 162 self.run_cancel()љ 163 163 self.step_id = self.game_length + 666љ 164 љ root = tk.Tk()љ 165 љ end_label = tk.Label(root, text="End")љ 166 љ end_label.pack()љ 167 љ root.mainloop()љ љ 164 w = self.canvas.winfo_width()љ љ 165 h = self.canvas.winfo_height()љ љ 166 cw = w/float(self.engine.field.w)љ љ 167 ch = h/float(self.engine.field.h)љ љ 168 c = min(cw, ch)љ љ 169 field_geometry = (self.engine.field.w*c,self.engine.field.h*c)љ љ 170 offset = ((w - field_geometry[0])/2.0, (h - field_geometry[1])/2.0)љ љ 171 self.canvas.create_text(offset[0]+ field_geometry[0]/2.0, offset[1]+field_geometry[1]/2.0, text="End of the round", fill="white", font="bold")љ 168 172 passљ 169 173 љ
Note: See TracChangeset
for help on using the changeset viewer.