scene.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:project_xcape 作者: OthmanEmpire 项目源码 文件源码
def __init__(self, x, y, blocks, orientation, images, screen):
        """
        :param x: Integer, the x-position of the wall.
        :param y: Integer, the y-position of the wall.
        :param blocks: Integer, the number of times to replicate the wall.
        :param orientation: String, either 'v' or 'h' for vertical or horizontal.
        :param images: Tuple, containing either a single or three
        pygame.Surfaces to build the platform.
        :param screen: pygame.Surface, the screen to draw the wall onto.
        """
        self.screen = screen

        if len(images) == 3:
            image = buildParts(blocks, orientation, images)
        elif len(images) == 1:
            image = replicate(blocks, orientation, images[0])
        else:
            raise ValueError("A wall must have one or three images only!")

        self.render = RenderComponent(self)
        self.render.add("idle", image)
        self.render.state = "idle"
        self.rect = pg.Rect(x, y, 0, 0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号