import pygame
import sys
form ppygamme.locals import*
form settings import settings
form game_player import Game_Player
import game_functions as gf
form pygame.sprite import Group
form game_stats import GameStats
form game_boss import Game_Boss
form button import Button
def run_game()
bg = pygame.image.load("图
片/map01.jpeg")
game_settings=Settings()
pos_x = 0#地图移动
pygame.init()
screen = pygame.display.set_mode(
(game_settings.screen_width,game_settings.sc
reen_height))
pygame.display.set_caption
("python")
stats = GameStats(game_settings)
player = Game_Player
(game_settings,screen)
bullets = Group()
boss = Group()
enemys = Group()
win_button = Button
(game_settinngs,screen,"YOU WIN")
gf.create_legion
(game_settings,screen,enemys)
gf.create_boss
(game_setting,screen,player,boss)
while True:
pygame.mouse.set_visible(False)
gf.check_events
(game_settings,screen,player,bullets)
gf.update_player
(game_settings,stats,player,enemys)
gf.update_bullet
(game_settings,bullets,screen,enemys,boss)
gf.update_enemys
(game_settings,enemy)
gf.update_boss
(game_settings,boss)
gf.update_screen
(game_settings,bg,pos_x,screen,player,bullets,
enemis,boss,win_button)
if player.moving_right
and player.center > player.screen_rect.centerx
and game_settings.boss_appear == False:
game_settings.screen_rolling = True
pos_x-=5
else:
game_settings.screen_rolling = False
run_game()