        if moveLeft and playerRect.left > 0:
            playerRect.move_ip(-1 * PLAYERMOVERATE, 0)
        if moveRight and playerRect.right < WINDOWWIDTH:
            playerRect.move_ip(PLAYERMOVERATE, 0)
        if moveUp and playerRect.top > 0:
            playerRect.move_ip(0,-1 * PLAYERMOVERATE)
        if moveDown and playerRect.bottom > 0:
            playerRect.move_ip(0, +1 * PLAYERMOVERATE)



moveX,moveY=0,0

class Player:
    def __init__(self,x,y):
        self.x=x
        self.y=y
        self.width=30
        self.height=30

    def render(self):
        windowSurface.blit(playerImage, (self.x,slef.y,self.width,self.height))
        playerImageSet = pygame.image.load('Player.png')
        playerImage = pygame.image.load('Player.png')
        playerImageL = pygame.image.load('PlayerL.png')
        playerImageR = pygame.image.load('PlayerR.png')
        playerImageD = pygame.image.load('PlayerD.png')

        playerRectSet = playerImage.get_rect()
        playerRect = playerImage.get_rect()
        playerRectL = playerImageL.get_rect()
        playerRectR = playerImageR.get_rect()
        playerRectD = playerImageD.get_rect()

        if moveLeft== True:
            playerImage=playerImageL
            playerRect=playerRectL
        if moveRight== True:
            playerImage=playerImageR
            playerRect=playerRectR
        if moveUp== True:
            playerImage=playerImage
            playerRect=playerRect
        if moveDown== True:
            playerImage=playerImageD
            playerRect=playerRectD
        else:
            playerImage= playerImageSet
            playerRect=playerRectSet
    


            if event.type == KEYDOWN:
                if event.key == K_LEFT or event.key == ord('a'):
                    moveRight = False
                    moveLeft = True
                    moveX=-5
                if event.key == K_RIGHT or event.key == ord('d'):
                    moveLeft = False
                    moveRight = True
                    moveX=5
                if event.key == K_UP or event.key == ord('w'):
                    moveUp = True
                    moveDown = False
                    moveY=-5
                if event.key == K_DOWN or event.key == ord('s'):
                    moveUp = False
                    moveDown = True
                    moveY=-5
            if event.type == KEYUP:
                if event.key == K_ESCAPE:
                        terminate()

                if event.key == K_LEFT or event.key == ord('a'):
                    moveLeft = False
                    moveX=0
                if event.key == K_RIGHT or event.key == ord('d'):
                    moveRight = False
                    moveX=0
                if event.key == K_DOWN or event.key == ord('s'):
                    moveDown = False
                    moveX=0
                if event.key == K_UP or event.key == ord('w'):
                    moveUp = False
                    moveX=0

                    # Move the player around.
        if moveLeft== True:
            playerImage=playerImageL
            playerRect=playerRectL
        if moveRight== True:
            playerImage=playerImageR
            playerRect=playerRectR
        if moveUp== True:
            playerImage=playerImage
            playerRect=playerRect
        if moveDown== True:
            playerImage=playerImageD
            playerRect=playerRectD
    playerImage= playerImageSet
    playerRect=playerRectSet





    , pygame.FULLSCREEN
