import pygame, display

class Map:
    
    def __init__ (self,filename):
        self.map = pygame.image.load( filename )
        self.map = self.map.convert()
    
    def draw(self,screen,view_rect):
        screen.blit(self.map,display.abs_to_screen(self.map.get_rect(),view_rect))

if __name__ == "__main__":

    import pygame,sys,random

#init pygame
    pygame.init()
#set up dimensions and saved colors
    size = width,height = 800,600
    black = 0,0,0
    white = 255,255,255
#setup a clock for FPS stuffs
    clock = pygame.time.Clock()
#set up the screen
    screen = pygame.display.set_mode(size)
#set up a font for writing to the screen
    font = pygame.font.Font(None,32)
    display_rect = pygame.Rect((0,220),(100,100))
    score_rect = pygame.Rect((200,220),(100,100))
    map = Map("testmap.png",0,0)
    mappositionx=0
    mappositiony=0
    while True:
        for event in pygame.event.get():
        #handle closing the game
            if event.type == pygame.QUIT:
                sys.exit()

            #clear the screen
        map.updatemap(mappositionx,mappositiony,width,height)
        mappositionx+=1
        mappositiony+=1
        screen.fill(black)
        map.drawmap(screen)
    #draw the paddle
    #tell the screen to update
        pygame.display.flip()
    #use the clock to limit the game to 40 frames/sec
        clock.tick(60)
