中途岛海战向下滚动背景类测试程序

"""
   向下滚动的背景
"""
__author__ = '李兴球'
__date__ = '2019/9/16'

import pygame
from pygame.locals import *

main():
    """主要函数"""
    bg = 'images/海洋.png'    
    width,height = size = 960,720
    
    screen = pygame.display.set_mode(size)
    pygame.display.set_caption("中途岛海战向下滚动背景测试程序by李兴球")
    bg_image = pygame.image.load(bg)
    
    scrbg = ScrollBackground(bg_image,screen)
    clock = pygame.time.Clock()
    
    running = True
    while running:
        for event in pygame.event.get():
            if event.type == QUIT:running = False

        scrbg.update()

        screen.fill((0,120,172))
        scrbg.draw()
        pygame.display.update()
        clock.tick(60)
        
    pygame.quit()
    


class ScrollBackground:
    """滚动的背景"""
    """以下仅会员查看"""
    

You must log in to read the rest of this article. Please log in or register as a user.