mp5

def draw_a_cover(BOARD,boxs,boxx,boxy,coverage):
        #要有动画效果的话,底层总是要先画一下
        pygame.draw.rect(DISPLAYSURF, boxs[boxx][boxy].color, (XRBW(boxs[boxx][boxy].x), YRBW(boxs[boxx][boxy].y), BOXWIDTH, BOXHEIGHT))
        #pygame.draw.rect(DISPLAYSURF, COVERCOLOR, (XRBW(boxs[boxx][boxy].x)+coverage, YRBW(boxs[boxx][boxy].y), BOXWIDTH-coverage, BOXHEIGHT))  
        #print "coverage:",coverage
        pygame.draw.rect(DISPLAYSURF, COVERCOLOR, (XRBW(boxs[boxx][boxy].x), YRBW(boxs[boxx][boxy].y), coverage, BOXHEIGHT))  
        pygame.display.update()
        FPSCLOCK.tick(FPS)
       
               
def anim_reveal(boxs,boxx,boxy):
    i = boxx
    j = boxy
    boxs[i][j].set_surf_color(boxs[i][j].color)
    for coverage in range(BOXWIDTH, -1, -REVEALSPEED):
        if coverage >=0:
            draw_a_cover(BOARD,boxs, boxx, boxy, coverage)

def anim_cover(boxs,first_select,boxx,boxy):
    for coverage in range(0, BOXWIDTH+1, REVEALSPEED):
        if coverage >=0:
            draw_a_cover(BOARD,boxs, first_select.boxx, first_select.boxy, coverage)
            #print "omg"
            draw_a_cover(BOARD,boxs, boxx, boxy, coverage)


def is_won(boxs):
    for i in range(NUMBOXHORIZONTAL):
        for j in range(NUMBOXVERTIVAL):
            if boxs[i][j].is_revealed == False:
                return False
    return True  
  
def main():  
    global FPSCLOCK,LIVES
    FPSCLOCK = pygame.time.Clock()           
    mousex,mousey = 0,0
    boxs = init_boxs_pixel_x_y_relative_BOARD()
    shuffle_boxs_color(boxs)
    first_select = None  
    lives = LIVES   
   

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值