import pygame

class graphicsScreen:
    def __init__(self, xsize, ysize):
        try:
            pygame.init()
            self.size = self.width, self.height = xsize*4, ysize*4
            self.screen = pygame.display.set_mode(self.size)
            pygame.display.update()
        except Exception, e:
            print str(e)

    def clear(self):
        self.screen.fill((255,255,255))

    def show_protein(self, place, protein):
        self.clear()
        last=None
        cnt = 0
        for i in place:
            i = (i[0]*20, i[1]*20)
            if last:
                pygame.draw.line(self.screen, (0,0,0), last, i, 4)
            last=i
            if protein[cnt] == 'H': color=(0, 0, 255)
            else: color=(255, 0, 0)
            cnt=cnt+1
            pygame.draw.circle(self.screen, color, i, 10) 
        pygame.display.update()


