Beispiel #1
0
def inverse_statue(self,scale):
    
    out = pg.Surface((scale,scale))
    out.convert()
    out.fill(gc.WHITE)
    
    size = int(float(scale) * 15 / 20 )
    push = int((scale - size)*2/3 + 1)
    gc.screenprint(out,"G",[push,0],size,gc.BLACK)
    
    return out
Beispiel #2
0
def classic_key(self,scale):
    
    out = pg.Surface((scale,scale))
    out.convert()
    out.fill((63,63,63))
    out.set_colorkey((63,63,63))
    
    size = int(float(scale)*3/4 )
    push = int((scale)/4 + 1)
    gc.screenprint(out,"-",[push,0],size,gc.GOLDEN_ROD)
    
    return out
Beispiel #3
0
def classic_badass(self,scale):
    
    out = pg.Surface((scale,scale))
    out.convert()
    out.fill((63,63,63))
    out.set_colorkey((63,63,63))
    
    size = int(float(scale) * 15 / 20 )
    push = int((scale - size)*2/3 + 1)
    gc.screenprint(out,"W",[push,0],size,gc.YELLOW)
    
    return out
Beispiel #4
0
def classic_hash(self,scale = 15):
        
    out = pg.Surface((scale,scale))
    out.convert()
    out.fill((0,0,0))
        
    pg.draw.rect(out,(255,255,255),(1,1,scale-2,scale-2))
    
    size = int(float(scale) )
    push = int((scale - size)*4/3+3)
    gc.screenprint(out,"#",[push,-2],size,gc.BLACK)
    return out
Beispiel #5
0
def classic_up(self,scale):
    
    if self.open:
        bg = gc.BLACK
        fg = gc.WHITE
    else:
        bg = gc.WHITE
        fg = gc.BLACK
    
    out = pg.Surface((scale,scale))
    out.convert()
    out.fill(bg)
    
    size = int(float(scale) * 15 / 20 )
    push = int((scale - size)*2/3 + 1)
    gc.screenprint(out,"<",[push,0],size,fg)
    
    return out
Beispiel #6
0
def empty_square(self,scale = 15):
    
    
    out = pg.Surface((scale,scale))
    out.convert()
    out.fill((0,0,0))
        
    pg.draw.rect(out,(255,255,255),(1,1,scale-2,scale-2),1)
    
    if self.occupant:
        top = self.occupant.view(self.occupant,scale)
        out.blit(top,[0,0])
    elif self.contains:
        top = self.contains[0].view(self.contains[0],scale)
        out.blit(top,[0,0])
    elif self.room:
        gc.screenprint(out,str(self.room),[15,2],8)
        if self.room.get_center() == self:
            pg.draw.circle(out,(255,255,255),(7,17),3)
    
    return out
def draw_background(background):
    """ Draws analagous wiring onto the background.

        background is a gameclass Background object."""
    
    #
    # Create a field to draw
    #
    
    field = pg.Surface(background.get_size())
    field.convert()
    field.fill(gc.BLACK)
    
    #
    # Draw analogy here:
    #
    
    pg.draw.line(field,gc.WHITE,(250,375),(250,325),2)
    pg.draw.line(field,gc.WHITE,(175,175),(175,550),2)
    
    pg.draw.line(field,gc.WHITE,(400,375),(400,250),2)
 #   pg.draw.line(field,gc.WHITE,(550,250),(550,325),2)
    pg.draw.line(field,gc.WHITE,(175,325),(475,325),2)
    pg.draw.line(field,gc.WHITE,(400,250),(550,250),2)
    pg.draw.line(field,gc.WHITE,(325,300),(325,175),2)
    
 #   pg.draw.line(field,gc.WHITE,(475,375),(400,375),2)
    pg.draw.line(field,gc.WHITE,(475,500),(475,325),2)
    pg.draw.line(field,gc.WHITE,(475,225),(475,175),2)
    pg.draw.line(field,gc.WHITE,(550,250),(550,375),2)
    
    
    pg.draw.line(field,gc.WHITE,(550,250),(850,250),2)
    pg.draw.line(field,gc.WHITE,(700,250),(700,500),2)
    pg.draw.line(field,gc.WHITE,(475,500),(700,500),2)
    pg.draw.line(field,gc.WHITE,(600,175),(850,175),2)
    pg.draw.line(field,gc.WHITE,(850,550),(850,175),2)
    pg.draw.line(field,gc.WHITE,(175,550),(850,550),2)
    pg.draw.line(field,gc.WHITE,(700,400),(850,400),2)
    
    gc.draw_not(field,(150,236),50)
    gc.draw_not(field,(600,225),50)
    gc.draw_not(field,(675,300),50)
    gc.draw_not(field,(750,225),50)
    gc.draw_not(field,(825,300),50)
    gc.draw_or(field,(300,300),50)
    gc.draw_or(field,(675,225),50)
    gc.draw_or(field,(825,225),50)
    gc.draw_and(field,(825,375),50)
    gc.draw_and(field,(450,225),50)
    
    
    gc.screenprint(field,"not-A",[150,120])
    gc.screenprint(field,"A or B",[300,120])
    gc.screenprint(field,"B and C",[440,120])
    gc.screenprint(field ,"not-(B and C)",[575,70])
    gc.screenprint(field ,"and",[610,95])
    gc.screenprint(field ,"not-(not-B or not-C)",[550,120])
    
    pg.draw.circle(field,gc.BLACK,[175,175],25)
    pg.draw.circle(field,gc.BLACK,[325,175],25)
    pg.draw.circle(field,gc.BLACK,[475,175],25)
    pg.draw.circle(field,gc.BLACK,[625,175],25)
    
    pg.draw.circle(field,gc.WHITE,[175,175],25,3)
    pg.draw.circle(field,gc.WHITE,[325,175],25,3)
    pg.draw.circle(field,gc.WHITE,[475,175],25,3)
    pg.draw.circle(field,gc.WHITE,[625,175],25,3)


    gc.screenprint(field,"2",[170,165])
    gc.screenprint(field,"4a",[315,165])
    gc.screenprint(field,"4b",[465,165])
    gc.screenprint(field,"5",[620,165])
    
    
    gc.screenprint(field,"A",[245,410])
    gc.screenprint(field,"B",[395,410])
    gc.screenprint(field,"C",[545,410])

    #
    # Draw onto the background.
    #
    
    background.detail(field,(0,0))
    
    pass
def draw_background(background):
    """ Draws analagous wiring onto the background.

        background is a gameclass Background object."""

    #
    # Create a field to draw
    #

    field = pg.Surface(background.get_size())
    field.convert()
    field.fill(gc.BLACK)

    #
    # Draw analogy here:
    #

    pg.draw.line(field, gc.WHITE, (250, 375), (250, 325), 2)
    pg.draw.line(field, gc.WHITE, (175, 175), (175, 550), 2)

    pg.draw.line(field, gc.WHITE, (400, 375), (400, 250), 2)
    #   pg.draw.line(field,gc.WHITE,(550,250),(550,325),2)
    pg.draw.line(field, gc.WHITE, (175, 325), (475, 325), 2)
    pg.draw.line(field, gc.WHITE, (400, 250), (550, 250), 2)
    pg.draw.line(field, gc.WHITE, (325, 300), (325, 175), 2)

    #   pg.draw.line(field,gc.WHITE,(475,375),(400,375),2)
    pg.draw.line(field, gc.WHITE, (475, 500), (475, 325), 2)
    pg.draw.line(field, gc.WHITE, (475, 225), (475, 175), 2)
    pg.draw.line(field, gc.WHITE, (550, 250), (550, 375), 2)

    pg.draw.line(field, gc.WHITE, (550, 250), (850, 250), 2)
    pg.draw.line(field, gc.WHITE, (700, 250), (700, 500), 2)
    pg.draw.line(field, gc.WHITE, (475, 500), (700, 500), 2)
    pg.draw.line(field, gc.WHITE, (600, 175), (850, 175), 2)
    pg.draw.line(field, gc.WHITE, (850, 550), (850, 175), 2)
    pg.draw.line(field, gc.WHITE, (175, 550), (850, 550), 2)
    pg.draw.line(field, gc.WHITE, (700, 400), (850, 400), 2)

    gc.draw_not(field, (150, 236), 50)
    gc.draw_not(field, (600, 225), 50)
    gc.draw_not(field, (675, 300), 50)
    gc.draw_not(field, (750, 225), 50)
    gc.draw_not(field, (825, 300), 50)
    gc.draw_or(field, (300, 300), 50)
    gc.draw_or(field, (675, 225), 50)
    gc.draw_or(field, (825, 225), 50)
    gc.draw_and(field, (825, 375), 50)
    gc.draw_and(field, (450, 225), 50)

    gc.screenprint(field, "not-A", [150, 120])
    gc.screenprint(field, "A or B", [300, 120])
    gc.screenprint(field, "B and C", [440, 120])
    gc.screenprint(field, "not-(B and C)", [575, 70])
    gc.screenprint(field, "and", [610, 95])
    gc.screenprint(field, "not-(not-B or not-C)", [550, 120])

    pg.draw.circle(field, gc.BLACK, [175, 175], 25)
    pg.draw.circle(field, gc.BLACK, [325, 175], 25)
    pg.draw.circle(field, gc.BLACK, [475, 175], 25)
    pg.draw.circle(field, gc.BLACK, [625, 175], 25)

    pg.draw.circle(field, gc.WHITE, [175, 175], 25, 3)
    pg.draw.circle(field, gc.WHITE, [325, 175], 25, 3)
    pg.draw.circle(field, gc.WHITE, [475, 175], 25, 3)
    pg.draw.circle(field, gc.WHITE, [625, 175], 25, 3)

    gc.screenprint(field, "2", [170, 165])
    gc.screenprint(field, "4a", [315, 165])
    gc.screenprint(field, "4b", [465, 165])
    gc.screenprint(field, "5", [620, 165])

    gc.screenprint(field, "A", [245, 410])
    gc.screenprint(field, "B", [395, 410])
    gc.screenprint(field, "C", [545, 410])

    #
    # Draw onto the background.
    #

    background.detail(field, (0, 0))

    pass