carmunk.py 文件源码

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

项目:ml_capstone 作者: drscott173 项目源码 文件源码
def create_cat(self):
        # Create a lighter body in PyMunk to represent a fast moving cat
        inertia = pymunk.moment_for_circle(1, 0, 14*self.game.scale, (0, 0))
        self.cat_body = pymunk.Body(1, inertia)
        self.cat_body.position = 50*self.game.scale, self.game.height - 100*self.game.scale
        self.cat_shape = pymunk.Circle(self.cat_body, 30*self.game.scale)
        self.cat_shape.color = THECOLORS["orange"]
        self.cat_shape.elasticity = 1.0
        self.cat_shape.angle = 0.5
        direction = Vec2d(1, 0).rotated(self.cat_body.angle)
        self.space.add(self.cat_body, self.cat_shape)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号