vikings.py 文件源码

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

项目:spygame 作者: sven1977 项目源码 文件源码
def __init__(self, shooter):
        """
        :param Sprite shooter: the shooter that shoots this Arrow object
        """
        # init our recyclable SpriteSheet
        if not self.sprite_sheet:
            self.sprite_sheet = spyg.SpriteSheet("data/baleog.tsx")

        super().__init__(16, 16, self.sprite_sheet, {
            "default": "fly",  # the default animation to play
            "fly":     {"frames": [158, 159, 160, 161], "rate": 1 / 10},
        }, shooter, anim_settings_name="arrow", width_height=(16, 5), image_rect=pygame.Rect(-8, -13, 32, 32))

        self.type = spyg.Sprite.get_type("arrow,particle")
        self.collision_mask = spyg.Sprite.get_type("default,enemy,friendly,coconut")

        # simple physics, no extra component needed for that
        self.ax = -10
        self.ay = 40
        self.vx = 300
        self.vy = -5
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号