def __init__(self, character, screenWidth, screenHeight, isRight, player):
    self.character = character
    self.player = player
    self.isRight = isRight
    if (self.character == 'subzero'):
        self.specialName = 'freeze'
    elif (self.character == 'scorpion'):
        self.specialName = 'spear'
    elif (self.character == 'raizen'):
        self.specialName = 'spirit shotgun'
    elif (self.character == 'goku'):
        self.specialName = 'kamehameha'
    elif (self.character == 'naruto'):
        self.specialName = 'rasengan'
    elif (self.character == 'sasuke'):
        self.specialName = 'chidori'
    Character.maxHeight = screenHeight
    Character.maxWidth = screenWidth
    margin = 5
    barMargin = (margin + 45)
    self.barHeight = 10
    self.healthY = 10
    self.healthWidth = 300
    self.health = Character.maxHealth
    self.healthColor = Character.green
    labeledge = 20
    if (self.player == 1):
        self.healthX = barMargin
    elif (self.player == 2):
        self.healthX = (((screenWidth - barMargin) - self.healthWidth) - labeledge)
    self.energyY = 30
    self.energy = Character.maxEnergy
    self.energyColor = Character.red
    if (self.player == 1):
        self.energyX = barMargin
    elif (self.player == 2):
        self.energyX = (((screenWidth - barMargin) - self.healthWidth) - labeledge)
    self.images = Character.charactersDict[character]
    characterInstances = ['icon', 'idle', 'jump', 'block', 'damage1', 'run', 'punch', 'kick', 'special1', 'effect1']
    self.spriteRightDict = {}
    i = 0
    for instance in characterInstances:
        self.spriteRightDict[instance] = self.spriteRightDict.get(instance, self.images[i])
        i += 1
    self.spriteLeftDict = {}
    j = 0
    for sprite in characterInstances:
        if (sprite == 'run'):
            self.spriteLeftDict[sprite] = self.images[j]
        image = pygame.transform.flip(self.images[j], True, False)
        self.spriteLeftDict[sprite] = self.spriteLeftDict.get(sprite, image)
        j += 1
    self.spriteDict = {}
    if self.isRight:
        self.spriteDict = self.spriteRightDict
        idleImage = self.spriteRightDict['idle']
        (w, h) = idleImage.get_size()
        x = (margin + (w // 2))
    elif (not self.isRight):
        self.spriteDict = self.spriteLeftDict
        idleImage = self.spriteLeftDict['idle']
        (w, h) = idleImage.get_size()
        x = ((screenWidth - margin) - (w // 2))
    r = (max(w, h) // 2)
    y = ((screenHeight - margin) - (h // 2))
    super(Character, self).__init__(x, y, idleImage, r)
    self.sounds = {}
    self.isDead = False
    self.isFlipped = False
    self.isIdle = True
    self.idleCount = 0
    self.isAttack = False
    self.isDamage = False
    self.damageCount = 1
    self.isRunLeft = False
    self.isRunRight = False
    self.isJump = False
    self.jumpVel = 10
    self.peakJump = (screenWidth // 4)
    self.idleY = self.y
    self.isBlock = False
    self.isPunch = False
    self.punchCount = 1
    self.punchDamage = 20
    self.isKick = False
    self.kickCount = 20
    self.kickDamage = 25
    self.isSpecial = False
    self.specialCount = 30
    self.specialDamage = 50
def __init__(self, character, screenWidth, screenHeight, isRight, player):
    self.character = character
    self.player = player
    self.isRight = isRight
    if (self.character == 'subzero'):
        self.specialName = 'freeze'
    elif (self.character == 'scorpion'):
        self.specialName = 'spear'
    elif (self.character == 'raizen'):
        self.specialName = 'spirit shotgun'
    elif (self.character == 'goku'):
        self.specialName = 'kamehameha'
    elif (self.character == 'naruto'):
        self.specialName = 'rasengan'
    elif (self.character == 'sasuke'):
        self.specialName = 'chidori'
    Character.maxHeight = screenHeight
    Character.maxWidth = screenWidth
    margin = 5
    barMargin = (margin + 45)
    self.barHeight = 10
    self.healthY = 10
    self.healthWidth = 300
    self.health = Character.maxHealth
    self.healthColor = Character.green
    labeledge = 20
    if (self.player == 1):
        self.healthX = barMargin
    elif (self.player == 2):
        self.healthX = (((screenWidth - barMargin) - self.healthWidth) - labeledge)
    self.energyY = 30
    self.energy = Character.maxEnergy
    self.energyColor = Character.red
    if (self.player == 1):
        self.energyX = barMargin
    elif (self.player == 2):
        self.energyX = (((screenWidth - barMargin) - self.healthWidth) - labeledge)
    self.images = Character.charactersDict[character]
    characterInstances = ['icon', 'idle', 'jump', 'block', 'damage1', 'run', 'punch', 'kick', 'special1', 'effect1']
    self.spriteRightDict = {}
    i = 0
    for instance in characterInstances:
        self.spriteRightDict[instance] = self.spriteRightDict.get(instance, self.images[i])
        i += 1
    self.spriteLeftDict = {}
    j = 0
    for sprite in characterInstances:
        if (sprite == 'run'):
            self.spriteLeftDict[sprite] = self.images[j]
        image = pygame.transform.flip(self.images[j], True, False)
        self.spriteLeftDict[sprite] = self.spriteLeftDict.get(sprite, image)
        j += 1
    self.spriteDict = {}
    if self.isRight:
        self.spriteDict = self.spriteRightDict
        idleImage = self.spriteRightDict['idle']
        (w, h) = idleImage.get_size()
        x = (margin + (w // 2))
    elif (not self.isRight):
        self.spriteDict = self.spriteLeftDict
        idleImage = self.spriteLeftDict['idle']
        (w, h) = idleImage.get_size()
        x = ((screenWidth - margin) - (w // 2))
    r = (max(w, h) // 2)
    y = ((screenHeight - margin) - (h // 2))
    super(Character, self).__init__(x, y, idleImage, r)
    self.sounds = {}
    self.isDead = False
    self.isFlipped = False
    self.isIdle = True
    self.idleCount = 0
    self.isAttack = False
    self.isDamage = False
    self.damageCount = 1
    self.isRunLeft = False
    self.isRunRight = False
    self.isJump = False
    self.jumpVel = 10
    self.peakJump = (screenWidth // 4)
    self.idleY = self.y
    self.isBlock = False
    self.isPunch = False
    self.punchCount = 1
    self.punchDamage = 20
    self.isKick = False
    self.kickCount = 20
    self.kickDamage = 25
    self.isSpecial = False
    self.specialCount = 30
    self.specialDamage = 50