Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改了部分地方使代码能够跑起来 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions GluttonousSnake/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Gomoku/ManAndMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Gomoku/ManAndMan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Binary file added Gomoku/__pycache__/checkerboard.cpython-36.pyc
Binary file not shown.
Binary file added Gomoku/五子棋(人机)-游戏截图.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MineSweeping/__pycache__/mineblock.cpython-36.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions MineSweeping/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added MineSweeping/扫雷-游戏截图.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Tetris/__pycache__/blocks.cpython-36.pyc
Binary file not shown.
10 changes: 2 additions & 8 deletions Tetris/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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):
Expand Down
Binary file added Tetris/俄罗斯方块-游戏截图.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.