예제 #1
0
def generate_cell_array(game_surface):
    cells = [[[] for x in range(0, NUMBER_OF_CELLS_PER_ROW)]
             for i in range(0, NUMBER_OF_CELLS_PER_ROW)]
    for i in range(0, NUMBER_OF_CELLS_PER_ROW):
        for j in range(0, NUMBER_OF_CELLS_PER_ROW):
            cells[i][j] = Cell(
                bool(random.getrandbits(1)),
                pg.__rect_constructor(i * SIZE_OF_CELL, j * SIZE_OF_CELL,
                                      SIZE_OF_CELL, SIZE_OF_CELL),
                game_surface, K)
    return cells
예제 #2
0
def draw_game_timer(display):
    #Text
    font_size = 22
    pygame.font.init()
    my_font = pygame.font.SysFont('Verdana', font_size)
    text_surface = my_font.render('Deadline: ', False, (0, 0, 0))
    display.blit(text_surface, (10, 510))
    #Box
    display.blit(timer_box_image, (125, 510))
    #Inner box
    inner_box_rect = pygame.__rect_constructor(
        126, 511, (648 * (GameLogic.current_timer / GameLogic.start_timer)),
        28)
    pygame.draw.rect(display, (175, 32, 24), inner_box_rect, 0)
예제 #3
0
def tela_b():
    pygame.init()

    maca = pygame.transform.scale(v.cenario.maca, (40, 40))
    lareira = pygame.transform.scale(v.cenario.lareira, (400, 300))
    moldura = pygame.transform.scale(v.cenario.moldura, (180, 220))
    luminaria_a = pygame.transform.scale(v.cenario.luminaria_a, (150, 150))
    prateleira = pygame.transform.scale(v.cenario.prateleira, (250, 75))
    alavanca_on = v.cenario.alavanca_on
    alavanca_off = v.cenario.alavanca_off
    porta = pygame.transform.scale(v.cenario.porta, (180, 350))
    porta_aberta = pygame.transform.scale(v.cenario.porta_aberta, (180, 350))
    base = pygame.__rect_constructor(-10, 738, 1376, 30)

    rectAlavanca = alavanca_on.get_rect(topleft=(120, 150))
    rectprateleira = pygame.__rect_constructor(460, 310, 470, 30)
    rectprateleira_a = pygame.__rect_constructor(70, 185, 240, 30)
    rectprateleira_b = pygame.__rect_constructor(1110, 510, 240, 30)
    rectAnnie = pygame.__rect_constructor(v.xAnnie + 10, v.yAnnie + 146, 84, 70)
    rectporta = porta.get_rect(topleft=(30, 350))
    rectmaca = maca.get_rect(topleft=(v.maca, 250))
    rectleft = pygame.__rect_constructor(-10, -10, 10, 800)
    rectright = pygame.__rect_constructor(1366, -10, 10, 800)

    collideleft = rectleft.colliderect(rectAnnie)
    collideright = rectright.colliderect(rectAnnie)
    collideporta = rectporta.colliderect(rectAnnie)
    collideprateleira = rectprateleira.colliderect(rectAnnie)
    collideprateleira_a = rectprateleira_a.colliderect(rectAnnie)
    collideprateleira_b = rectprateleira_b.colliderect(rectAnnie)
    collidealavanca = rectAlavanca.colliderect(rectAnnie)
    collidemaca = rectmaca.colliderect(rectAnnie)
    basecollide = base.colliderect(rectAnnie)

    v.tela.blit(prateleira, (450, 300))
    v.tela.blit(prateleira, (700, 300))
    v.tela.blit(prateleira, (60, 180))
    v.tela.blit(prateleira, (1100, 500))
    v.tela.blit(moldura, (300, 100))
    v.tela.blit(luminaria_a, (200, 300))
    v.tela.blit(luminaria_a, (1000, 300))
    v.tela.blit(lareira, (480, 410))
    v.tela.blit(maca, (v.maca, 250))

    if v.maca == 0:
        v.macaVel += 40
    if v.maca == 1320:
        v.macaVel -= 40
    v.maca = v.maca + v.macaVel

    if collideleft:
        v.xAnnie += 10
    if collideright:
        v.xAnnie -= 10

    if basecollide or collideprateleira or collideprateleira_a or collideprateleira_b:
        v.gravidade = 0
        if v.bPulo:
            v.gravidade = -37
    elif not (basecollide or collideprateleira or collideprateleira_a or collideprateleira_b) and not v.bPulo:
        v.gravidade = 37

    if collidemaca:
        v.xAnnie = v.largura / 2
        v.yAnnie = 580

    if not v.alavanca_off:
        v.tela.blit(alavanca_on, (120, 100))

    if collidealavanca:
        if v.alavanca:
            v.alavanca_off = True
            v.tela_e = True

    if v.tela_b:
        v.tela.blit(porta_aberta, (30, 350))
        if collideporta and v.tela_e:
            v.annie_tela = 2
            v.maca = 0
            v.macaVel = 0
            v.alavanca_off = False
            v.tela_e = False

    if not v.tela_b:
        v.tela.blit(porta, (30, 350))

    if v.alavanca_off:
        v.tela.blit(alavanca_off, (82, 142))
예제 #4
0
def tela_d():
    pygame.init()

    grade = pygame.transform.scale(v.gcenario.grade, (75, 230))
    guarda_roupa = pygame.transform.scale(v.gcenario.guarda_roupa, (275, 500))
    espelho = pygame.transform.scale(v.gcenario.espelho, (250, 300))
    cama = pygame.transform.scale(v.gcenario.cama, (400, 300))
    luminaria_a = pygame.transform.scale(v.gcenario.luminaria_a, (150, 150))
    prateleira = pygame.transform.scale(v.gcenario.prateleira, (250, 75))
    chave = pygame.transform.scale(v.gcenario.chave, (120, 60))
    alavanca_on = v.gcenario.alavanca_on
    alavanca_off = v.gcenario.alavanca_off
    porta = pygame.transform.scale(v.gcenario.porta, (180, 350))
    porta_aberta = pygame.transform.scale(v.gcenario.porta_aberta, (180, 350))
    base = pygame.__rect_constructor(-10, 738, 1376, 30)

    rectporta = porta.get_rect(topleft=(760, 350))
    rectgrade = grade.get_rect(topleft=(180, 0))
    rectAlavanca = alavanca_on.get_rect(topleft=(50, 115))
    rectcamal = pygame.__rect_constructor(420, 560, 2, 400)
    rectcamar = pygame.__rect_constructor(800, 560, 2, 400)
    rectcamat = pygame.__rect_constructor(430, 550, 360, 2)
    rectprateleirat = pygame.__rect_constructor(0, 220, 240, 2)
    rectprateleirab = pygame.__rect_constructor(0, 250, 240, 2)
    rectGuarda_roupal = pygame.__rect_constructor(1030, 230, 2, 500)
    rectGuarda_roupar = pygame.__rect_constructor(1260, 230, 2, 500)
    rectGuarda_roupat = pygame.__rect_constructor(1040, 210, 190, 2)
    rectchave = chave.get_rect(topleft=(1250, 650))
    rectGregor = v.gplayer.GregorEntrando[0].get_rect(topleft=(v.xGregor,
                                                               v.yGregor))

    collideporta = rectporta.colliderect(rectGregor)
    collideprateleirat = rectprateleirat.colliderect(rectGregor)
    collideprateleirab = rectprateleirab.colliderect(rectGregor)
    collidekey = rectchave.colliderect(rectGregor)
    collidecamal = rectcamal.colliderect(rectGregor)
    collidecamar = rectcamar.colliderect(rectGregor)
    collidecamat = rectcamat.colliderect(rectGregor)
    collideGuarda_roupal = rectGuarda_roupal.colliderect(rectGregor)
    collideGuarda_roupar = rectGuarda_roupar.colliderect(rectGregor)
    collideGuarda_roupat = rectGuarda_roupat.colliderect(rectGregor)
    collidealavanca = rectAlavanca.colliderect(rectGregor)
    collidegrade = rectgrade.colliderect(rectGregor)
    basecollide = base.colliderect(rectGregor)

    v.tela.blit(prateleira, (0, 200))
    v.tela.blit(cama, (400, 450))
    v.tela.blit(luminaria_a, (v.largura / 2, 50))
    v.tela.blit(espelho, (75, 375))
    v.tela.blit(guarda_roupa, (1000, 210))

    if collidekey:
        v.key = True
    elif not v.key:
        v.tela.blit(grade, (180, 0))
        v.tela.blit(chave, (1250, 650))
    elif v.key:
        collidegrade = False

    if basecollide or collidecamat or collideGuarda_roupat or collideprateleirat:
        v.yGregor -= 5

    if collidecamal or collideGuarda_roupal:
        v.xGregor -= 5

    if collidecamar or collideGuarda_roupar or collidegrade:
        v.xGregor += 5

    if collideprateleirab:
        v.yGregor += 5

    if not v.alavanca_off:
        v.tela.blit(alavanca_on, (50, 115))

    if collidealavanca:
        if v.alavanca:
            v.alavanca_off = True
            v.tela_a = True

    if v.alavanca_off:
        v.tela.blit(alavanca_off, (12, 157))

    if v.tela_d:
        v.tela.blit(porta_aberta, (830, 350))
        if collideporta and v.tela_a:
            v.key = False
            v.gregor_tela = 1
            v.alavanca_off = False
            v.tela_a = False
            v.maca = 0

    if not v.tela_d:
        v.tela.blit(porta, (830, 350))
예제 #5
0
def tela_f():
    pygame.init()

    maca = pygame.transform.scale(v.gcenario.maca, (40, 40))
    moldura = pygame.transform.scale(v.gcenario.moldura, (180, 220))
    guarda_roupa = pygame.transform.scale(v.gcenario.guarda_roupa, (275, 500))
    cama = pygame.transform.scale(v.gcenario.cama, (400, 300))
    luminaria_a = pygame.transform.scale(v.gcenario.luminaria_a, (150, 150))
    alavanca_on = v.gcenario.alavanca_on
    alavanca_off = v.gcenario.alavanca_off
    porta = pygame.transform.scale(v.gcenario.porta, (180, 350))
    porta_aberta = pygame.transform.scale(v.gcenario.porta_aberta, (180, 350))
    base = pygame.__rect_constructor(-10, 738, 1376, 30)

    rectAlavanca = alavanca_on.get_rect(topleft=(1200, 600))
    rectcamal = pygame.__rect_constructor(170, 560, 2, 400)
    rectcamar = pygame.__rect_constructor(560, 560, 2, 400)
    rectcamat = pygame.__rect_constructor(180, 550, 360, 2)
    rectGuarda_roupal = pygame.__rect_constructor(550, 230, 2, 500)
    rectGuarda_roupar = pygame.__rect_constructor(820, 230, 2, 500)
    rectGuarda_roupat = pygame.__rect_constructor(570, 220, 220, 2)
    rectGregor = v.gplayer.GregorEntrando[0].get_rect(topleft=(v.xGregor,
                                                               v.yGregor))
    rectporta = porta.get_rect(topleft=(900, 350))
    rectmaca = maca.get_rect(topleft=(v.maca, 250))
    rectmaca_a = maca.get_rect(topleft=(850, v.maca_y))
    rectmaca_b = maca.get_rect(topleft=(1100, v.maca_y))

    collidemaca = rectmaca.colliderect(rectGregor)
    collidemaca_a = rectmaca_a.colliderect(rectGregor)
    collidemaca_b = rectmaca_b.colliderect(rectGregor)
    collideporta = rectporta.colliderect(rectGregor)
    collidecamal = rectcamal.colliderect(rectGregor)
    collidecamar = rectcamar.colliderect(rectGregor)
    collidecamat = rectcamat.colliderect(rectGregor)
    collideGuarda_roupal = rectGuarda_roupal.colliderect(rectGregor)
    collideGuarda_roupar = rectGuarda_roupar.colliderect(rectGregor)
    collideGuarda_roupat = rectGuarda_roupat.colliderect(rectGregor)
    collidealavanca = rectAlavanca.colliderect(rectGregor)
    basecollide = base.colliderect(rectGregor)

    v.tela.blit(cama, (150, 450))
    v.tela.blit(luminaria_a, (v.largura / 2, 50))
    v.tela.blit(guarda_roupa, (550, 210))
    v.tela.blit(moldura, (200, 250))
    v.tela.blit(maca, (v.maca, 250))
    v.tela.blit(maca, (850, v.maca_y))
    v.tela.blit(maca, (1100, v.maca_y))

    if v.maca == 0:
        v.macaVel += 10
    if v.maca == 420:
        v.macaVel -= 10
    v.maca = v.maca + v.macaVel
    if v.maca_y == 0:
        v.macaVely += 20
    if v.maca_y == 680:
        v.macaVely -= 20
    v.maca_y = v.maca_y + v.macaVely

    if collidemaca or collidemaca_a or collidemaca_b:
        v.xGregor = 10
        v.yGregor = 560

    if basecollide or collidecamat or collideGuarda_roupat:
        v.yGregor -= 5

    if collidecamal or collideGuarda_roupal:
        v.xGregor -= 5

    if collidecamar or collideGuarda_roupar:
        v.xGregor += 5

    if not v.alavanca_off:
        v.tela.blit(alavanca_on, (1200, 600))

    if collidealavanca:
        if v.alavanca:
            v.alavanca_off = True
            v.tela_c = True

    if v.alavanca_off:
        v.tela.blit(alavanca_off, (1162, 642))

    if v.tela_f:
        v.tela.blit(porta_aberta, (900, 350))
        if collideporta and v.tela_c:
            v.gregor_tela = 3
            v.alavanca_off = False
            v.tela_c = False

    if not v.tela_f:
        v.tela.blit(porta, (900, 350))
예제 #6
0
def tela_e():
    pygame.init()

    maca = pygame.transform.scale(v.gcenario.maca, (40, 40))
    g = pygame.transform.scale(v.gcenario.grade, (75, 230))
    moldura = pygame.transform.scale(v.gcenario.moldura, (180, 220))
    grade = pygame.transform.rotate(g, 270)
    guarda_roupa = pygame.transform.scale(v.gcenario.guarda_roupa, (275, 500))
    cama = pygame.transform.scale(v.gcenario.cama, (400, 300))
    luminaria_a = pygame.transform.scale(v.gcenario.luminaria_a, (150, 150))
    prateleira = pygame.transform.scale(v.gcenario.prateleira, (250, 75))
    chave = pygame.transform.scale(v.gcenario.chave, (120, 60))
    alavanca_on = v.gcenario.alavanca_on
    alavanca_off = v.gcenario.alavanca_off
    porta = pygame.transform.scale(v.gcenario.porta, (180, 350))
    porta_aberta = pygame.transform.scale(v.gcenario.porta_aberta, (180, 350))
    base = pygame.__rect_constructor(-10, 738, 1376, 30)

    rectgrade = grade.get_rect(topleft=(1140, 220))
    rectAlavanca = alavanca_on.get_rect(topleft=(1200, 600))
    rectcamal = pygame.__rect_constructor(170, 560, 2, 400)
    rectcamar = pygame.__rect_constructor(560, 560, 2, 400)
    rectcamat = pygame.__rect_constructor(180, 550, 360, 2)
    rectprateleirat = pygame.__rect_constructor(0, 220, 240, 2)
    rectprateleirab = pygame.__rect_constructor(0, 250, 240, 2)
    rectGuarda_roupal = pygame.__rect_constructor(920, 230, 2, 500)
    rectGuarda_roupar = pygame.__rect_constructor(1160, 230, 2, 500)
    rectGuarda_roupat = pygame.__rect_constructor(930, 220, 220, 2)
    rectchave = chave.get_rect(topleft=(50, 150))
    rectGregor = v.gplayer.GregorEntrando[0].get_rect(topleft=(v.xGregor,
                                                               v.yGregor))
    rectporta = porta.get_rect(topleft=(700, 350))
    rectmaca = maca.get_rect(topleft=(v.maca, 250))

    collidemaca = rectmaca.colliderect(rectGregor)
    collideporta = rectporta.colliderect(rectGregor)
    collideprateleirat = rectprateleirat.colliderect(rectGregor)
    collideprateleirab = rectprateleirab.colliderect(rectGregor)
    collidekey = rectchave.colliderect(rectGregor)
    collidecamal = rectcamal.colliderect(rectGregor)
    collidecamar = rectcamar.colliderect(rectGregor)
    collidecamat = rectcamat.colliderect(rectGregor)
    collideGuarda_roupal = rectGuarda_roupal.colliderect(rectGregor)
    collideGuarda_roupar = rectGuarda_roupar.colliderect(rectGregor)
    collideGuarda_roupat = rectGuarda_roupat.colliderect(rectGregor)
    collidealavanca = rectAlavanca.colliderect(rectGregor)
    collidegrade = rectgrade.colliderect(rectGregor)
    basecollide = base.colliderect(rectGregor)

    v.tela.blit(prateleira, (0, 200))
    v.tela.blit(cama, (150, 450))
    v.tela.blit(luminaria_a, (v.largura / 2, 50))
    v.tela.blit(guarda_roupa, (900, 210))
    v.tela.blit(moldura, (300, 250))
    v.tela.blit(maca, (v.maca, 250))

    if v.maca == 0:
        v.macaVel += 20
    if v.maca == 840:
        v.macaVel -= 20
    v.maca = v.maca + v.macaVel

    if collidemaca:
        v.xGregor = 10
        v.yGregor = 560

    if collidekey:
        v.key = True
    elif not v.key:
        v.tela.blit(grade, (1140, 200))
        v.tela.blit(chave, (50, 150))
    elif v.key:
        collidegrade = False

    if basecollide or collidecamat or collideGuarda_roupat or collideprateleirat or collidegrade:
        v.yGregor -= 5

    if collidecamal or collideGuarda_roupal:
        v.xGregor -= 5

    if collidecamar or collideGuarda_roupar:
        v.xGregor += 5

    if collideprateleirab:
        v.yGregor += 5

    if not v.alavanca_off:
        v.tela.blit(alavanca_on, (1200, 600))

    if collidealavanca:
        if v.alavanca:
            v.alavanca_off = True
            v.tela_b = True

    if v.alavanca_off:
        v.tela.blit(alavanca_off, (1162, 642))

    if v.tela_e:
        v.tela.blit(porta_aberta, (700, 350))
        if collideporta and v.tela_b:
            v.gregor_tela = 2
            v.alavanca_off = False
            v.tela_b = False
            v.maca = 0
            v.macaVel = 0
            v.xGregor = 50
            v.yGregor = 650

    if not v.tela_e:
        v.tela.blit(porta, (700, 350))
예제 #7
0
def tela_a():
    pygame.init()

    guarda_roupa = pygame.transform.scale(v.cenario.guarda_roupa, (275, 500))
    cama = pygame.transform.scale(v.cenario.cama, (400, 300))
    luminaria_a = pygame.transform.scale(v.cenario.luminaria_a, (150, 150))
    prateleira = pygame.transform.scale(v.cenario.prateleira, (250, 75))
    alavanca_on = v.cenario.alavanca_on
    alavanca_off = v.cenario.alavanca_off
    porta = pygame.transform.scale(v.cenario.porta, (180, 350))
    porta_aberta = pygame.transform.scale(v.cenario.porta_aberta, (180, 350))
    base = pygame.__rect_constructor(-10, 738, 1376, 30)

    rectAlavanca = alavanca_on.get_rect(topleft=(120, 150))
    rectcama = pygame.__rect_constructor(990, 600, 350, 50)
    rectprateleira = pygame.__rect_constructor(570, 340, 200, 30)
    rectGuarda_roupa = pygame.__rect_constructor(50, 260, 275, 30)
    rectAnnie = pygame.__rect_constructor(v.xAnnie, v.yAnnie + 186, 110, 35)
    rectporta = porta.get_rect(topleft=(760, 350))
    rectleft = pygame.__rect_constructor(-10, -10, 10, 800)
    rectright = pygame.__rect_constructor(1366, -10, 10, 800)

    collideleft = rectleft.colliderect(rectAnnie)
    collideright = rectright.colliderect(rectAnnie)
    collideporta = rectporta.colliderect(rectAnnie)
    collideGuarda_roupa = rectGuarda_roupa.colliderect(rectAnnie)
    collideprateleira = rectprateleira.colliderect(rectAnnie)
    collidecama = rectcama.colliderect(rectAnnie)
    collidealavanca = rectAlavanca.colliderect(rectAnnie)
    basecollide = base.colliderect(rectAnnie)

    v.tela.blit(prateleira, (550, 330))
    v.tela.blit(cama, (950, 450))
    v.tela.blit(luminaria_a, (300, 300))
    v.tela.blit(luminaria_a, (1000, 300))

    if collideleft:
        v.xAnnie += 10
    if collideright:
        v.xAnnie -= 10

    if basecollide or collidecama or collideprateleira or collideGuarda_roupa:
        v.gravidade = 0
        if v.bPulo:
            v.gravidade = -37
    elif not (basecollide or collidecama or collideprateleira
              or collideGuarda_roupa) and not v.bPulo:
        v.gravidade = 37

    if not v.alavanca_off:
        v.tela.blit(alavanca_on, (120, 150))

    if collidealavanca:
        if v.alavanca:
            v.alavanca_off = True
            v.tela_d = True

    if v.alavanca_off:
        v.tela.blit(alavanca_off, (82, 192))

    if v.tela_a:
        v.tela.blit(porta_aberta, (760, 350))
        if collideporta and v.tela_d:
            v.annie_tela = 1
            v.alavanca_off = False
            v.tela_d = False
    if not v.tela_a:
        v.tela.blit(porta, (760, 350))

    v.tela.blit(guarda_roupa, (50, 210))
예제 #8
0
def tela_c():
    pygame.init()

    maca = pygame.transform.scale(v.cenario.maca, (40, 40))
    piano = pygame.transform.scale(v.cenario.piano, (500, 400))
    grade = pygame.transform.scale(v.cenario.grade, (75, 230))
    moldura = pygame.transform.scale(v.cenario.moldura, (180, 220))
    chave = pygame.transform.scale(v.cenario.chave, (120, 60))
    luminaria_a = pygame.transform.scale(v.cenario.luminaria_a, (150, 150))
    prateleira = pygame.transform.scale(v.cenario.prateleira, (250, 75))
    alavanca_on = v.cenario.alavanca_on
    alavanca_off = v.cenario.alavanca_off
    porta = pygame.transform.scale(v.cenario.porta, (180, 350))
    porta_aberta = pygame.transform.scale(v.cenario.porta_aberta, (180, 350))
    base = pygame.__rect_constructor(-10, 738, 1376, 30)

    rectAlavanca = alavanca_on.get_rect(topleft=(120, 150))
    rectprateleira = pygame.__rect_constructor(360, 310, 460, 30)
    rectprateleira_a = pygame.__rect_constructor(0, 170, 240, 30)
    rectprateleira_b = pygame.__rect_constructor(1100, 170, 240, 30)
    rectpiano = pygame.__rect_constructor(980, 560, 500, 30)
    rectAnnie = pygame.__rect_constructor(v.xAnnie + 10, v.yAnnie + 146, 74,
                                          70)
    rectmaca = maca.get_rect(topleft=(v.maca, 250))
    rectmaca_a = maca.get_rect(topleft=(v.maca_a, 250))
    rectgrade = grade.get_rect(topleft=(180, -10))
    rectgrade_a = grade.get_rect(topleft=(1086, -10))
    rectkey = chave.get_rect(topleft=(560, 260))
    rectkey_a = chave.get_rect(topleft=(1175, 140))
    rectporta = porta.get_rect(topleft=(30, 350))
    rectleft = pygame.__rect_constructor(-10, -10, 10, 800)
    rectright = pygame.__rect_constructor(1366, -10, 10, 800)

    collideleft = rectleft.colliderect(rectAnnie)
    collideright = rectright.colliderect(rectAnnie)
    collideporta = rectporta.colliderect(rectAnnie)
    collidegrade = rectgrade.colliderect(rectAnnie)
    collidegrade_a = rectgrade_a.colliderect(rectAnnie)
    collidekey = rectkey.colliderect(rectAnnie)
    collidekey_a = rectkey_a.colliderect(rectAnnie)
    collideprateleira = rectprateleira.colliderect(rectAnnie)
    collideprateleira_a = rectprateleira_a.colliderect(rectAnnie)
    collideprateleira_b = rectprateleira_b.colliderect(rectAnnie)
    collidealavanca = rectAlavanca.colliderect(rectAnnie)
    basecollide = base.colliderect(rectAnnie)
    collidemaca = rectmaca.colliderect(rectAnnie)
    collidemaca_a = rectmaca_a.colliderect(rectAnnie)
    collidepiano = rectpiano.colliderect(rectAnnie)

    v.tela.blit(prateleira, (350, 300))
    v.tela.blit(prateleira, (600, 300))
    v.tela.blit(prateleira, (0, 180))
    v.tela.blit(prateleira, (1100, 180))
    v.tela.blit(moldura, (500, 400))
    v.tela.blit(luminaria_a, (200, 300))
    v.tela.blit(luminaria_a, (1000, 300))
    v.tela.blit(maca, (v.maca, 250))
    v.tela.blit(maca, (v.maca_a, 250))
    v.tela.blit(piano, (900, 400))

    if collideleft:
        v.xAnnie += 10
    if collideright:
        v.xAnnie -= 10

    if v.maca == 0:
        v.macaVel += 15
    if v.maca == 630:
        v.macaVel -= 15
    v.maca = v.maca + v.macaVel

    if v.maca_a == 660:
        v.macaVel_a += 15
    if v.maca_a == 1290:
        v.macaVel_a -= 15
    v.maca_a = v.maca_a + v.macaVel_a

    if collidekey:
        v.key = True
    elif not v.key:
        v.tela.blit(grade, (1086, -10))
        v.tela.blit(chave, (560, 260))
    elif v.key:
        collidegrade_a = False

    if collidegrade_a:
        v.xAnnie -= 10

    if collidekey_a:
        v.key_a = True
    elif not v.key_a:
        v.tela.blit(grade, (180, -10))
        v.tela.blit(chave, (1175, 140))
    elif v.key_a:
        collidegrade = False

    if collidegrade:
        v.xAnnie += 10

    if basecollide or collideprateleira or collideprateleira_a or collideprateleira_b or collidepiano:
        v.gravidade = 0
        if v.bPulo:
            v.gravidade = -37
    elif not (basecollide or collideprateleira or collideprateleira_a
              or collideprateleira_b or collidepiano) and not v.bPulo:
        v.gravidade = 37

    if collidemaca or collidemaca_a:
        v.xAnnie = v.largura / 2
        v.yAnnie = 580

    if not v.alavanca_off:
        v.tela.blit(alavanca_on, (80, 100))

    if collidealavanca:
        if v.alavanca:
            v.alavanca_off = True
            v.tela_f = True

    if v.tela_c:
        v.tela.blit(porta_aberta, (30, 350))
        if collideporta and v.tela_f:
            v.annie_tela = 3
            v.alavanca_off = False
            v.tela_f = False

    if not v.tela_c:
        v.tela.blit(porta, (30, 350))

    if v.alavanca_off:
        v.tela.blit(alavanca_off, (42, 142))