pygame Sprite类3
Group
# coding: utf-8
# 作者:爱编程的章老师
# 创建:2021/1/26 8:46 下午
# 邮箱:slxxf000@163.com
# 微信:slxxfl
# 微信公众号:A卫隆少儿编程
# 格言:给自己的生活增加一份向上的力,每都进步一点点
import pygame
import sys
class Ball(pygame.sprite.Sprite):
def __init__(self, screen, radius, c=(255, 0, 0), direct=1):
super().__init__()
self.image = pygame.Surface((2 * radius, 2 * radius))
pygame.draw.circle(self.image, c, (radius, radius), radius)
sw, sh = screen.get_size()
self.rect = pygame.Rect(</