pong.py 文件源码

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

项目:kvae 作者: simonkamronn 项目源码 文件源码
def create_ball(self, radius=3):
        inertia = pymunk.moment_for_circle(1, 0, radius, (0, 0))
        body = pymunk.Body(1, inertia)
        position = np.array(self.initial_position) + self.initial_std * np.random.normal(size=(2,))
        position = np.clip(position, self.dd + radius + 1, self.res[0] - self.dd - radius - 1)
        body.position = position

        shape = pymunk.Circle(body, radius, (0, 0))
        shape.elasticity = .9
        shape.color = color["white"]
        return shape
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号