File tree 1 file changed +17
-18
lines changed
1 file changed +17
-18
lines changed Original file line number Diff line number Diff line change @@ -56,32 +56,31 @@ def render():
56
56
safe = True
57
57
playing = True
58
58
while playing :
59
- pygame .time .delay (5 )
60
59
61
60
pos = None
62
- for event in pygame .event .get ():
61
+ event = pygame .event .wait ()
63
62
64
- if not safe :
65
- board .show_mines ()
63
+ if not safe :
64
+ board .show_mines ()
66
65
67
- if event .type == pygame .MOUSEBUTTONDOWN :
68
- leftclick , _ , rightclick = pygame .mouse .get_pressed ()
69
- pos = pygame .mouse .get_pos ()
66
+ if event .type == pygame .MOUSEBUTTONDOWN :
67
+ leftclick , _ , rightclick = pygame .mouse .get_pressed ()
68
+ pos = pygame .mouse .get_pos ()
70
69
71
- if rightclick :
72
- board .rightclick (pos )
73
- flag_count = _render_flg_count (
74
- board .n_mines , len (board .flags )
75
- )
70
+ if rightclick :
71
+ board .rightclick (pos )
72
+ flag_count = _render_flg_count (
73
+ board .n_mines , len (board .flags )
74
+ )
76
75
77
- elif leftclick and not safe :
78
- playing = False
76
+ elif leftclick and not safe :
77
+ playing = False
79
78
80
- elif leftclick :
81
- safe = board .leftclick (pos )
79
+ elif leftclick :
80
+ safe = board .leftclick (pos )
82
81
83
- if event .type == pygame .QUIT :
84
- playing = False
82
+ if event .type == pygame .QUIT :
83
+ playing = False
85
84
86
85
render ()
87
86
You can’t perform that action at this time.
0 commit comments