on-internet
← Community

Should I use space.static_body or create my own static body?

Stack Overflow ·

I've been trying out Pymunk, and I wanted to create a static body. I've been using pymunk.Body so far: space = pymunk.Space() body = pymunk.Body(body_type=pymunk.Body.STATIC) shape = pymunk.Circle(body, radius=10) space.add(body, shape) But I recently learnt that space has its own static body space.static_body: space = pymunk.Space() shape = pymunk.Circle(space.static_body, radius=10) space.add(shape) From the docs: property static_body: Body A dedicated static body for the space. You don’t have to use it, but many times it can be convenient to have a static body together with the space. Anoth

Comments

Sign in or sign up to comment and upvote.

No comments yet.