import pygame
from pygame import *

class DisplayHandler:
    def __init__(self):
        self.bg = Surface((800, 640))
        self.bg.convert()
        self.bg.fill(Color("#FFFFFF"))

    def update(self,screen, player, mh, kh):

                screen.blit(self.bg, (0, 0))
                self.updatePlayer(screen, player)
                solid = Surface((32, 32))
                solid.convert()
                solid.fill(Color("#222222"))

                # Will check to see if the map needs to be swapped and will display the appropriate map
                if (kh.kworld_swap == True):
                    for tile in mh.map_a:
                        screen.blit(solid,(tile.locX,tile.locY ))
                elif (kh.kworld_swap == False):
                    for tile in mh.map_b:
                        screen.blit(solid,(tile.locX,tile.locY ))

                pygame.display.flip()

    # Blits the player to the screen by accessing the characterSkin variable(spriteSheet) and uses the
    # coordinate data stored in the spriteSheet
    def updatePlayer(self, screen, player):

        screen.blit(player.characterSkin.animation, (player.left, player.top),
    		(int(player.characterSkin.imageData.imagesCoors[player.characterSkin.currentImage]['xCoor']) / 2,
			int(player.characterSkin.imageData.imagesCoors[player.characterSkin.currentImage]['yCoor']) / 2,
			int(player.characterSkin.imageData.imagesCoors[player.characterSkin.currentImage]['width']) / 2,
			int(player.characterSkin.imageData.imagesCoors[player.characterSkin.currentImage]['height']) / 2))

9b507b84e0f3921da02cfa6bc2cfc4626d670b47
<mask token>


class DisplayHandler:

    def __init__(self):
        self.bg = Surface((800, 640))
        self.bg.convert()
        self.bg.fill(Color('#FFFFFF'))
    <mask token>
    <mask token>

<mask token>


class DisplayHandler:

    def __init__(self):
        self.bg = Surface((800, 640))
        self.bg.convert()
        self.bg.fill(Color('#FFFFFF'))
    <mask token>

    def updatePlayer(self, screen, player):
        screen.blit(player.characterSkin.animation, (player.left, player.
            top), (int(player.characterSkin.imageData.imagesCoors[player.
            characterSkin.currentImage]['xCoor']) / 2, int(player.
            characterSkin.imageData.imagesCoors[player.characterSkin.
            currentImage]['yCoor']) / 2, int(player.characterSkin.imageData
            .imagesCoors[player.characterSkin.currentImage]['width']) / 2, 
            int(player.characterSkin.imageData.imagesCoors[player.
            characterSkin.currentImage]['height']) / 2))

<mask token>


class DisplayHandler:

    def __init__(self):
        self.bg = Surface((800, 640))
        self.bg.convert()
        self.bg.fill(Color('#FFFFFF'))

    def update(self, screen, player, mh, kh):
        screen.blit(self.bg, (0, 0))
        self.updatePlayer(screen, player)
        solid = Surface((32, 32))
        solid.convert()
        solid.fill(Color('#222222'))
        if kh.kworld_swap == True:
            for tile in mh.map_a:
                screen.blit(solid, (tile.locX, tile.locY))
        elif kh.kworld_swap == False:
            for tile in mh.map_b:
                screen.blit(solid, (tile.locX, tile.locY))
        pygame.display.flip()

    def updatePlayer(self, screen, player):
        screen.blit(player.characterSkin.animation, (player.left, player.
            top), (int(player.characterSkin.imageData.imagesCoors[player.
            characterSkin.currentImage]['xCoor']) / 2, int(player.
            characterSkin.imageData.imagesCoors[player.characterSkin.
            currentImage]['yCoor']) / 2, int(player.characterSkin.imageData
            .imagesCoors[player.characterSkin.currentImage]['width']) / 2, 
            int(player.characterSkin.imageData.imagesCoors[player.
            characterSkin.currentImage]['height']) / 2))

import pygame
from pygame import *


class DisplayHandler:

    def __init__(self):
        self.bg = Surface((800, 640))
        self.bg.convert()
        self.bg.fill(Color('#FFFFFF'))

    def update(self, screen, player, mh, kh):
        screen.blit(self.bg, (0, 0))
        self.updatePlayer(screen, player)
        solid = Surface((32, 32))
        solid.convert()
        solid.fill(Color('#222222'))
        if kh.kworld_swap == True:
            for tile in mh.map_a:
                screen.blit(solid, (tile.locX, tile.locY))
        elif kh.kworld_swap == False:
            for tile in mh.map_b:
                screen.blit(solid, (tile.locX, tile.locY))
        pygame.display.flip()

    def updatePlayer(self, screen, player):
        screen.blit(player.characterSkin.animation, (player.left, player.
            top), (int(player.characterSkin.imageData.imagesCoors[player.
            characterSkin.currentImage]['xCoor']) / 2, int(player.
            characterSkin.imageData.imagesCoors[player.characterSkin.
            currentImage]['yCoor']) / 2, int(player.characterSkin.imageData
            .imagesCoors[player.characterSkin.currentImage]['width']) / 2, 
            int(player.characterSkin.imageData.imagesCoors[player.
            characterSkin.currentImage]['height']) / 2))

import pygame
from pygame import *

class DisplayHandler:
    def __init__(self):
        self.bg = Surface((800, 640))
        self.bg.convert()
        self.bg.fill(Color("#FFFFFF"))

    def update(self,screen, player, mh, kh):

                screen.blit(self.bg, (0, 0))
                self.updatePlayer(screen, player)
                solid = Surface((32, 32))
                solid.convert()
                solid.fill(Color("#222222"))

                # Will check to see if the map needs to be swapped and will display the appropriate map
                if (kh.kworld_swap == True):
                    for tile in mh.map_a:
                        screen.blit(solid,(tile.locX,tile.locY ))
                elif (kh.kworld_swap == False):
                    for tile in mh.map_b:
                        screen.blit(solid,(tile.locX,tile.locY ))

                pygame.display.flip()

    # Blits the player to the screen by accessing the characterSkin variable(spriteSheet) and uses the
    # coordinate data stored in the spriteSheet
    def updatePlayer(self, screen, player):

        screen.blit(player.characterSkin.animation, (player.left, player.top),
    		(int(player.characterSkin.imageData.imagesCoors[player.characterSkin.currentImage]['xCoor']) / 2,
			int(player.characterSkin.imageData.imagesCoors[player.characterSkin.currentImage]['yCoor']) / 2,
			int(player.characterSkin.imageData.imagesCoors[player.characterSkin.currentImage]['width']) / 2,
			int(player.characterSkin.imageData.imagesCoors[player.characterSkin.currentImage]['height']) / 2))
