【发布时间】:2022-01-26 08:36:35
【问题描述】:
我正在制作一个游戏,我正在那里使用墙壁。我想为他们做一个设计,但我不知道该怎么做。我正在考虑制作一个图像并从中裁剪每个墙壁,这取决于它的大小。我怎样才能做到这一点?我只是在这里填充了一种颜色。
class Wall(pygame.sprite.Sprite):
def __init__(self, x, y, width, height):
super().__init__()
self.image = pygame.Surface([width, height])
self.image.fill((50,50,225)
self.rect = self.image.get_rect()
self.rect.y = y
self.rect.x = x
我说的是这些墙:
【问题讨论】:
-
只需使用绘画或其他类似的应用程序并在那里绘制它