diff --git a/GluttonousSnake/main.py b/GluttonousSnake/main.py index 582ce19..db52ed9 100644 --- a/GluttonousSnake/main.py +++ b/GluttonousSnake/main.py @@ -85,8 +85,8 @@ def main(): while True: for event in pygame.event.get(): - if event.type == QUIT: - sys.exit() + if event.type == pygame.QUIT: + pygame.quit() elif event.type == KEYDOWN: if event.key == K_RETURN: if game_over: diff --git "a/GluttonousSnake/\350\264\252\345\220\203\350\233\207 - \346\270\270\346\210\217\346\210\252\345\233\276.png" "b/GluttonousSnake/\350\264\252\345\220\203\350\233\207-\346\270\270\346\210\217\346\210\252\345\233\276.png" similarity index 100% rename from "GluttonousSnake/\350\264\252\345\220\203\350\233\207 - \346\270\270\346\210\217\346\210\252\345\233\276.png" rename to "GluttonousSnake/\350\264\252\345\220\203\350\233\207-\346\270\270\346\210\217\346\210\252\345\233\276.png" diff --git a/Gomoku/ManAndMachine.py b/Gomoku/ManAndMachine.py index a849500..3e41ab1 100644 --- a/Gomoku/ManAndMachine.py +++ b/Gomoku/ManAndMachine.py @@ -52,8 +52,8 @@ def main(): while True: for event in pygame.event.get(): - if event.type == QUIT: - sys.exit() + if event.type == pygame.QUIT: + pygame.quit() elif event.type == KEYDOWN: if event.key == K_RETURN: if winner is not None: diff --git a/Gomoku/ManAndMan.py b/Gomoku/ManAndMan.py index e878ac2..7648ccd 100644 --- a/Gomoku/ManAndMan.py +++ b/Gomoku/ManAndMan.py @@ -49,8 +49,8 @@ def main(): while True: for event in pygame.event.get(): - if event.type == QUIT: - sys.exit() + if event.type == pygame.QUIT: + pygame.quit() elif event.type == KEYDOWN: if event.key == K_RETURN: if winner is not None: diff --git a/Gomoku/__pycache__/checkerboard.cpython-36.pyc b/Gomoku/__pycache__/checkerboard.cpython-36.pyc new file mode 100644 index 0000000..27ad3d6 Binary files /dev/null and b/Gomoku/__pycache__/checkerboard.cpython-36.pyc differ diff --git "a/Gomoku/\344\272\224\345\255\220\346\243\213\357\274\210\344\272\272\346\234\272\357\274\211-\346\270\270\346\210\217\346\210\252\345\233\276.PNG" "b/Gomoku/\344\272\224\345\255\220\346\243\213\357\274\210\344\272\272\346\234\272\357\274\211-\346\270\270\346\210\217\346\210\252\345\233\276.PNG" new file mode 100644 index 0000000..f6da1b5 Binary files /dev/null and "b/Gomoku/\344\272\224\345\255\220\346\243\213\357\274\210\344\272\272\346\234\272\357\274\211-\346\270\270\346\210\217\346\210\252\345\233\276.PNG" differ diff --git a/MineSweeping/__pycache__/mineblock.cpython-36.pyc b/MineSweeping/__pycache__/mineblock.cpython-36.pyc new file mode 100644 index 0000000..68a0fbe Binary files /dev/null and b/MineSweeping/__pycache__/mineblock.cpython-36.pyc differ diff --git a/MineSweeping/main.py b/MineSweeping/main.py index b48ddfb..06052ba 100644 --- a/MineSweeping/main.py +++ b/MineSweeping/main.py @@ -98,8 +98,8 @@ def main(): screen.fill(bgcolor) for event in pygame.event.get(): - if event.type == QUIT: - sys.exit() + if event.type == pygame.QUIT: + pygame.quit() elif event.type == MOUSEBUTTONDOWN: mouse_x, mouse_y = event.pos x = mouse_x // SIZE diff --git "a/MineSweeping/\346\211\253\351\233\267-\346\270\270\346\210\217\346\210\252\345\233\276.PNG" "b/MineSweeping/\346\211\253\351\233\267-\346\270\270\346\210\217\346\210\252\345\233\276.PNG" new file mode 100644 index 0000000..934a744 Binary files /dev/null and "b/MineSweeping/\346\211\253\351\233\267-\346\270\270\346\210\217\346\210\252\345\233\276.PNG" differ diff --git a/Tetris/__pycache__/blocks.cpython-36.pyc b/Tetris/__pycache__/blocks.cpython-36.pyc new file mode 100644 index 0000000..ea639b9 Binary files /dev/null and b/Tetris/__pycache__/blocks.cpython-36.pyc differ diff --git a/Tetris/main.py b/Tetris/main.py index 922900a..536718d 100644 --- a/Tetris/main.py +++ b/Tetris/main.py @@ -100,8 +100,8 @@ def _judge(pos_x, pos_y, block): while True: for event in pygame.event.get(): - if event.type == QUIT: - sys.exit() + if event.type == pygame.QUIT: + pygame.quit() elif event.type == KEYDOWN: if event.key == K_RETURN: if game_over: @@ -119,12 +119,6 @@ def _judge(pos_x, pos_y, block): pause = not pause elif event.key in (K_w, K_UP): # 旋转 - # 其实记得不是很清楚了,比如 - # .0. - # .00 - # ..0 - # 这个在最右边靠边的情况下是否可以旋转,我试完了网上的俄罗斯方块,是不能旋转的,这里我们就按不能旋转来做 - # 我们在形状设计的时候做了很多的空白,这样只需要规定整个形状包括空白部分全部在游戏区域内时才可以旋转 if 0 <= cur_pos_x <= BLOCK_WIDTH - len(cur_block.template[0]): _next_block = blocks.get_next_block(cur_block) if _judge(cur_pos_x, cur_pos_y, _next_block): diff --git "a/Tetris/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227-\346\270\270\346\210\217\346\210\252\345\233\276.png" "b/Tetris/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227-\346\270\270\346\210\217\346\210\252\345\233\276.png" new file mode 100644 index 0000000..a4a8d4e Binary files /dev/null and "b/Tetris/\344\277\204\347\275\227\346\226\257\346\226\271\345\235\227-\346\270\270\346\210\217\346\210\252\345\233\276.png" differ