title: 'Ball' object has no attribute 'body'
body: <p>I've seen similar question but I didn't get any answers from those. My error is</p>
  <blockquote>
  <p>'Ball' object has no attribute 'body'.</p>
  </blockquote>
  <pre class="lang-py prettyprint-override"><code>class Ball():
      def _init_(self):
          self.body = pymunk.Body()
          self.body.position = middlex, middley
          self.body.velocity = 400, -300
          self.shape = pymunk.Circle(self.body, 8)
          self.shape.density = 1
          self.shape.elasticity = 1
          space.add(self.body, self.shape)
          self.shape.collision_type = 1
      def draw(self):
          x, y = self.body.position # &lt;--- error
          pygame.draw.circle(display, (255, 255, 255), (int(x), int(y)), 8) 
  </code></pre>