Example #1
0
 SYNCHRONOUS = 0
 RESETFLAG = 0
 INPUT_VALUE = input_char()
 if INPUT_VALUE == 'q':
     print(Fore.RED + "YOU QUIT THE GAME")
     print(Fore.WHITE + "GAME OVER")
     print(Fore.BLUE + "YOUR SCORE: ",
           Fore.WHITE + str(TOTAL_SCORE + SCORE))
     sys.exit()
 if INPUT_VALUE != 0 and INPUT_VALUE != 'b':
     GRID = MAN.move(INPUT_VALUE, GRID, MOVE_TYPE, DETONATION)
     ESCAPED = 1
     if FLAG == 1:
         for ele in BOX[3]:
             if ele[0] == MAN.get_lefttop_x(
             ) and ele[1] == MAN.get_lefttop_y():
                 ESCAPED = 0
                 break
     if ESCAPED == 1:
         FLAG = 0
     if len(GRID) == 2:
         GRID = GRID[0]
         BOARD.print_board(GRID)
         print(Fore.RED + "LIFES AVAILABLE : ",
               Fore.WHITE + str(MAX_LIFES), '\t',
               Fore.MAGENTA + "YOUR SCORE : ",
               Fore.WHITE + str(TOTAL_SCORE + SCORE), '\t',
               Fore.GREEN + "TIME : ", Fore.WHITE + str(TIMER), '\t',
               Fore.CYAN + "Level :", Fore.WHITE + str(LEVEL))
         MAX_LIFES -= 1
         RESETFLAG = 1
Example #2
0
 Synchronous = 0
 Resetflag = 0
 s = input_char()
 if s == 'q':
     print(Fore.RED + "YOU QUIT THE GAME")
     print(Fore.WHITE + "GAME OVER")
     print(Fore.BLUE + "YOUR SCORE: ",
           Fore.WHITE + str(TotalScore + score))
     sys.exit()
 if s != 0 and s != 'b':
     b = man.Move(s, b, move_type)
     escaped = 1
     if flag == 1:
         for ele in Box[3]:
             if ele[0] == man.get_lefttop_x(
             ) and ele[1] == man.get_lefttop_y():
                 escaped = 0
                 break
     if escaped == 1:  # If the bomberman escaped the blast
         flag = 0
     if len(b) == 2:
         b = b[0]
         a.PrintBoard(b)
         print(Fore.RED + "LIFES AVAILABLE : ",
               Fore.WHITE + str(max_lifes), '\t',
               Fore.MAGENTA + "YOUR SCORE : ",
               Fore.WHITE + str(TotalScore + score), '\t',
               Fore.GREEN + "TIME : ", Fore.WHITE + str(Timer), '\t',
               Fore.CYAN + "LEVEL :", Fore.WHITE + str(Level))
         # LENGTH OF TWO INDICATES BOMBERMAN COMMITED SUICIDE
         max_lifes -= 1