"""
pygame的Sprite类。
pygame面向对象编程最简学习示例代码。
"""
import pygame
class Sprite:
def __init__(self,image,pos):
"""
image:一个surface
pos:中心点坐标
"""
self.image = image # image是一个surface
self.rect = self.image.get_rect(center=pos)
image = "girl.png"
width,height = 480,360
center = width//2,height//2
查看完整源代码,请
需要浏览更多吗?
成为会员后,登陆才能继续浏览!联系微信scratch8即可办理会员。
(会员专属:能浏览所有文章,下载所有带链接的Python资源。)
