Self attribute not working pygame
<p>I am trying to create a simple object-oriented pong game. I have a <code>Player</code> object and one method (<code>create_paddle</code>). When I create an instance of <code>Player</code> and call the <code>create_paddle</code> method it gives me the following error:</p>

<pre><code>Traceback (most recent call last):
  File "C:\Users\jerem\Documents\python_programs\pong.py", line 30, in   &lt;module&gt;
    player1.create_paddle(30, 180, 15, 120)
TypeError: create_paddle() missing 1 required positional argument: 'h'
</code></pre>

<p>Program:</p>

<pre><code>class Player:

    def create_paddle(self, x, y, w, h):
        pygame.draw.rect(surface, white, (x, y, w, h))

player1 = Player
player1.create_paddle(30, 180, 15, 120)
</code></pre>

<p>I have looked up the error and no other posts helped. 
Any help is appreciated!
Thanks, JC</p>

<p>You're missing parentheses when creating the object:</p>

<pre><code>player1 = Player()
</code></pre>

<p>Which means you're just assigning player1 to Player and trying to call your method like a static method....so self isn't getting passed for you.</p>

<pre><code>player1.create_paddle(player1, 30, 180, 15, 120)
</code></pre>

<p>That is what python does for you behind the scenes.</p>

python python-3.x oop compiler-errors pygame