Skip to content
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ GPL

# Doc
[使用Pygame制作微信打飞机游戏PC版](https://www.cnblogs.com/dukeleo/p/3339780.html) (a Chinese startup)


[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)
6 changes: 4 additions & 2 deletions mainGame.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
# 定义敌机对象使用的surface相关参数
enemy1_rect = pygame.Rect(534, 612, 57, 43)
enemy1_img = plane_img.subsurface(enemy1_rect)
enemy1_down_imgs = []
enemy1_down_imgs = [ ]
enemy1_down_imgs.append(plane_img.subsurface(pygame.Rect(267, 347, 57, 43)))
enemy1_down_imgs.append(plane_img.subsurface(pygame.Rect(873, 697, 57, 43)))
enemy1_down_imgs.append(plane_img.subsurface(pygame.Rect(267, 296, 57, 43)))
Expand All @@ -64,7 +64,9 @@
# 存储被击毁的飞机,用来渲染击毁精灵动画
enemies_down = pygame.sprite.Group()


shoot_frequency = 0

enemy_frequency = 0

player_down_index = 16
Expand All @@ -77,7 +79,7 @@

while running:
# 控制游戏最大帧率为60
clock.tick(45)
clock.tick(50)

# 控制发射子弹频率,并发射子弹
if not player.is_hit:
Expand Down