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)
评论列表
文章目录