
鼠标动一动,有一种3D效果,配的音乐确实不错哦,充满梦幻的感觉。
"""动态背景_绿色瀑布风景waterfall parallax,这本来是一个scratch作品,现在用Python把它做一下."""
import pygame
from pygame.locals import *
width,height = 480,360
screen = pygame.display.set_mode((width,height))
pygame.display.set_caption("动态背景_绿色瀑布风景waterfall parallax www.lixingqiu.com")
pygame.mixer.init()
pygame.mixer.music.load("The Departure - Max Richter.mp3.wav")
pygame.mixer.music.play(-1,0)
costume1 = pygame.Surface((width,height))
costume1.fill((0,102,34))
costume2 = pygame.image.load("images/costume2.png").convert_alpha()
costume2_rect = costume2.get_rect()
costume3 = pygame.image.load("images/costume3.png").convert_alpha()
costume3_rect = costume3.get_rect()
costume4 = pygame.image.load("images/costume4.png").convert_alpha()
costume4_rect = costume4.get_rect()
costume5 = pygame.image.load("images/costume5.png").convert_alpha()
costume5_rect = costume5.get_rect()
costume6 = pygame.image.load("images/costume6.png").convert_alpha()
costume6_rect = costume6.get_rect()
costume7 = pygame.image.load("images/costume7.png").convert_alpha()
costume7_rect = costume7.get_rect()
clock = pygame.time.Clock()
running = True
while running:
event = pygame.event.poll()
if event.type == QUIT:running = False
mx,my = pygame.mouse.get_pos()
pygame.display.update()
clock.tick(30)
pygame.quit()
下载完整源代码与素材,请
需要浏览更多吗?
成为会员后,登陆才能继续浏览!联系微信scratch8即可办理会员。
(会员专属:能浏览所有文章,下载所有带链接的Python资源。)
