Pygame将绘制每艘飞船。 为在游戏开始时让玩家知道他有多少艘飞船,我们在开始新游戏时调用prep_ships()。...if pygame.sprite.spritecollideany(ship, aliens):
2 ship_hit(ai_settings, screen, stats, sb, ship, aliens...14.4 小结
在本章中,你学习了如何创建用于开始新游戏的Play按钮,如何检测鼠标事件,以及在游戏 处于活动状态时如何隐藏光标。...第15 章
生成数据
15.1 安装 matplotlib
首先,需要安装matplotlib,我们将使用它来制作开始的几个图表。如果你还未使用过pip, 请参阅12.2.1节。...plt
squares = [1, 4, 9, 16, 25]
plt.plot(squares)
plt.show()
15.1.5 matplotlib 画廊
要查看使用matplotlib可制作的各种图表