aliens

pygame外星人2

梦想与她 提交于 2019-11-28 20:29:50
---恢复内容开始--- 一、game_functions将各个模块的功能整合起来,供主文件调用 1 # -*- coding:utf-8 -*- 2 3 import sys 4 import pygame 5 from bullets import Bullet 6 from alien import Alien 7 from pygame.sprite import Sprite 8 import time 9 10 11 12 def check_keydown_events(ai_settings, event, screen, ship, bullets): 13 '''响应按键''' 14 if event.key == pygame.K_RIGHT: 15 '''更新移动标志''' 16 ship.moving_right = True 17 elif event.key == pygame.K_LEFT: 18 ship.moving_left = True 19 elif event.key == pygame.K_UP: 20 ship.moving_up = True 21 elif event.key == pygame.K_DOWN: 22 ship.moving_down = True 23 elif event.key == pygame.K