专栏名称: Python学习交流
每天更新,更新python相关的知识。希望诸君有所收获!
目录
相关文章推荐
Python爱好者社区  ·  月薪3万35岁脑干出血程序员:ICU躺了28 ... ·  昨天  
Python爱好者社区  ·  务必立即拿下软考证(政策红利) ·  2 天前  
Python爱好者社区  ·  软考,yyds ·  昨天  
Python爱好者社区  ·  Science披露:近3年,垃圾论文激增,9 ... ·  2 天前  
51好读  ›  专栏  ›  Python学习交流

我的毕设终于搞定了!题为:利用Python开发一款游戏!

Python学习交流  · 公众号  · Python  · 2019-01-04 15:43

正文

请到「今天看啥」查看全文



# 画网格线 横线
for y in range(BLOCK_HEIGHT):
pygame.draw.line(screen, BLACK, (0, y * SIZE), (BLOCK_WIDTH * SIZE, y * SIZE), 1)
print_text(screen, font1, font_pos_x, 10, f'得分: ')
print_text(screen, font1, font_pos_x, 10 + font1_height + 6, f'{score}')
print_text(screen, font1, font_pos_x, 20 + (font1_height + 6) * 2, f'速度: ')
print_text(screen, font1, font_pos_x, 20 + (font1_height + 6) * 3, f'{score // 10000}')
print_text(screen, font1, font_pos_x, 30 + (font1_height + 6) * 4, f'下一个:')
pygame.display.flip()
if __name__ == '__main__':
main()

方块

接下来就是要定义方块,方块的形状一共有以下 7 种:


I 型


O 型


T 型


S 型


Z 型


L 型







请到「今天看啥」查看全文