NameError: global name 'player' is not defined
<p>Well I am building a PyGame in Sublime text, but when I run the batch file to start it I get this error: </p>

<hr>

<pre><code>Traceback (most recent call last):
 File "game.py", line 12, in &lt;module&gt;
    player = player("Default", 1, 1, 1)
 File "C:\Users\*****\Desktop\RPG\characters\player.py", line 8, in __init__
    Character.__init__(self, name, hp)
 File "C:\Users\*****\Desktop\RPG\characters\character.py", line 9, in  __init__
player.dead = False
NameError: global name 'player' is not defined
Press any key to continue . . .
</code></pre>

<p>Now here are my files:</p>

<p>game.py file:</p>

<hr>

<pre><code># Main Game File

from characters.player import *
from commands import *

commands = {
    'help': help,
    'exit': exit
 }
player = player("Default", 1, 1, 1)

def isValidCMD(cmd):
    if cmd in commands:
        return True
    return False

def runCMD(cmd, args, player):
    commands[cmd](player, args)

def main(player):
    while(not player.dead):
            line = raw_input("&gt;&gt; ")
        input = line.split()
        input.append("EOI")

        if isValidCMD(input[0]):
            runCMD(input[0], input[1], player)

        main(player)
</code></pre>

<p>player.py file:</p>

<hr>

<pre><code># Player Base File

from character import *

class player(Character):
    def __init__(self, name, hp, str, int):
        Character.__init__(self, name, hp)
        self.str = str
        self.int = int
</code></pre>

<p>and the character.py file:</p>

<hr>

<pre><code># Character Base File

class Character(object):
    def __init__(self, name, hp):
        self.name = name
        self.hp = hp

        player.dead = False

    def attack(self, other):
        pass

    def update(self):
        if self.hp &lt;= 0:
            player.dead = True
            self.hp = 0
</code></pre>

<hr>

<p>What do I do?</p>