mp4

来源:互联网 发布:大闹天宫捕鱼源码 编辑:程序博客网 时间:2024/05/17 08:03

def init_boxs_pixel_x_y_relative_BOARD():
    boxs = []
    for i in range(NUMBOXHORIZONTAL):
        vert_boxs = []
        x = BOXMARGINWIDTH
        x += i * (BOXWIDTH + GAPBETBOXS)
        for j in range(NUMBOXVERTIVAL):
            y = BOXMARGINHEIGHT
            y += j * (BOXHEIGHT + GAPBETBOXS)
            box = Box(x,y,BOXWIDTH,BOXHEIGHT)
            box.boxx = i
            box.boxy = j                     
            vert_boxs.append(box)
        boxs.append(vert_boxs)
    return boxs

def draw_covers(BOARD,boxs,coverage):
    for i in range(NUMBOXHORIZONTAL):
        for j in range(NUMBOXVERTIVAL):
            if boxs[i][j].is_revealed == False:
                boxs[i][j].set_surf_color(COVERCOLOR)
                DISPLAYSURF.blit(boxs[i][j].surf,(XRBW(boxs[i][j].x),YRBW(boxs[i][j].y)))
    #pygame.display.update()
    #FPSCLOCK.tick(FPS)

def draw_board(BOARD):
    #BOARD.fill(GRAY)
    DISPLAYSURF.blit(BOARD,(BOARDLEFT,BOARDTOP))

def draw_bar(BAR,lives):
    BAR = pygame.Surface((BARWIDTH,BARHEIGHT))
    BAR.fill(BLACK)    
    fontObj = pygame.font.Font('freesansbold.ttf', 16)
    textSurfaceObj = fontObj.render('LIVES:', True, GREEN, BLUE)
    textRectObj = textSurfaceObj.get_rect()
    textRectObj.left = 20
    BAR.blit(textSurfaceObj, textRectObj)
    fontObj2 = pygame.font.Font('freesansbold.ttf', 16)
    textSurfaceObj = fontObj2.render(str(lives), True, GREEN, BLUE)
    textRectObj = textSurfaceObj.get_rect()
    textRectObj.left = 80
    BAR.blit(textSurfaceObj, textRectObj)
    DISPLAYSURF.blit(BAR,(BARLEFT,BARTOP))