Example #1
0
 def __init__(self,text,func,topleft):
     self.text = text
     self.func = func
     self.image = util.get_image(util.BUTTON)
     self.pushed_image = util.get_image(util.PUSHED_BUTTON)
     self.rect = self.image.get_rect()
     self.rect.topleft = topleft
     self.pushed = 0
Example #2
0
 def __init__(self, id, topleft):
     self.id = id
     self.row = string.atoi(id[0])
     self.col = id[1]
     self.set_color(util.EMPTY)
     self.depth = 0
     self.rect = self.image.get_rect()
     self.highlight = util.get_image(util.HIGHLIGHT)
     self.target = util.get_image(util.TARGET)
     self.dvonn_marker = util.get_image(util.DVONN)
     self.rect.topleft = topleft
     self.dvonn = 0
Example #3
0
def main():

    if len(sys.argv) > 1 and \
       sys.argv[1] == "--about":
        about()
        return

    pygame.init()
    screen = pygame.display.set_mode(LAUNCH_SCREEN_RECT.size,0)
    util.initialize()
    pygame.display.set_caption("DVONN for One")
    icon = pygame.transform.scale(util.get_image("icon"),(32,32))
    pygame.display.set_icon(icon)
    clock = pygame.time.Clock()

    l = Launcher(screen,clock)
    l.run()
Example #4
0
 def __init__(self):
     self.spaces = {}
     tempImgRect = util.get_image(util.EMPTY).get_rect()
     top = INITIAL_TOP
     for row in ROW_RANGE:
         left = INITIAL_LEFT + (INITIAL_LEFT_MULT[row - 1] * tempImgRect.width)
         for col in COL_RANGE:
             if ((row == 5 and col in ("A","B")) or
                 (row == 4 and col == "A") or
                 (row == 2 and col == "K") or
                 (row == 1 and col in ("J","K"))):
                 continue
             
             id = str(row) + col
             s = Space(id, (left,top))
             self.spaces[id] = s
             left = left + tempImgRect.width
         top = top + tempImgRect.height
     self.selected = None
     self.targeted = None
     self.is_valid_id = self.spaces.has_key
     self.all_spaces = self.spaces.values()
Example #5
0
 def clear(self):
     self.background.fill( util.get_image(util.EMPTY).get_at( (0,0)))
Example #6
0
 def set_color(self,color):
     self.color = color
     self.image = util.get_image(self.color)