Exemplo n.º 1
0
    finally:
        termios.tcsetattr(fd, termios.TCSAFLUSH, oldterm)
        fcntl.fcntl(fd, fcntl.F_SETFL, oldflags)
    return c
qflag = 0
level = 1
while level <= 3:
    t = Terminal()
    bx = 0
    by = 0
    planted = False
    SCORE = 0
    flag = 0
    arr = [[' ' for i in range(76)] for y in range(38)]
    wall1 = Wall()
    arr = wall1.buildwall(arr)     # populate the array with the wall.
    bricks = Brick(t.cyan('/'))
    arr = bricks.place(arr)       # populate the array with the bricks.
    bomber = Bomberman(t.green('B'))
    num = randint(3*level, 4*level)
    enarr = []
    var = False
    for i in range(num):
        enarr.append(Enemy(t.red('E')))         # enarr is populated with all the enemies.
    arr = bomber.spawn(arr)             # bomberman is spawned.
    for i in range(0, num):
        arr = enarr[i].randspawn(arr)           # all the enemies are randomly spawned.
    if level == 1:
        lives = 3
    print t.blue('SCORE :- '), SCORE, t.blue('LIVES :- '), lives, t.blue('LEVEL :- '), level, t.yellow('\t\tBOMBERMAN\n')
    for i in range(38):