import pygame
class bird:
def __init__(self,window):
self.x = 200
self.y = 353
self.skin = pygame.image.load("bird.png")
self.window = window
self.gravity = 1
def move_up(self):
self.y -= 10
def show(self):
self.window.blit(self.skin,(self.x,self.y))
import pygame
import bird
pygame.init()
window = pygame.display.set_mode((401 ,706))
pygame.display.set_caption("管道小黑")
background = pygame.image.load('background.png')
shadiao_bird = bird.bird(window)
while True:
for shi_jian in pygame.event.get():
print(shi_jian)
if shi_jian.type == pygame.QUIT:
pygame.quit()
window.blit(background,(0,0))
shadiao_bird.show()
pygame.display.update()
pygame.quit()
转载请注明原文地址:https://ipadbbs.8miu.com/read-49612.html