Beispiel #1
0
    for event in pygame.event.get():
        if event.type == QUIT:
            exit()

    screen.blit(background, (0, 0))

    for x in range(X_INDEX):
        for y in range(Y_INDEX):
            if bomb_map.bombMatrix[y][x].TimePassed(current_time) == True:
                screen.blit(burst, (bomb_map.bombMatrix[y][x].GetX(),
                                    bomb_map.bombMatrix[y][x].GetY()))
                bomb_map.RemoveBomb(x, y)
            else:
                screen.blit(bomb_map.bombMatrix[y][x].GetImage(),
                            (bomb_map.bombMatrix[y][x].GetX(),
                             bomb_map.bombMatrix[y][x].GetY()))

    pressed_Key = pygame.key.get_pressed()

    blocks.PutsOnScreen(screen)

    #third argument pass how many time hada passed since last tiem
    p.Action(screen, pressed_Key, current_time, bomb_map)

    e.Action(screen, p, current_time)

    #Reset current time
    current_time = 0.0

    pygame.display.update()
Beispiel #2
0
        if item_time > 10:
            randomItem(1, item_images)
            item_time = 0

        for i in Item.pos:
            Item.pos[i].draw(screen)

        pressed_Key = pygame.key.get_pressed()
        if pressed_Key[pygame.K_ESCAPE]:
            stage_num = 3

#for block in all_blocks:
#		 block.PutsOnScreen(screen)

#third argument pass how many time hada passed since last tiem
        p.Action(screen, pressed_Key, current_time, bomb_map, all_blocks)

        for e in enemys:
            if type(e) is not Boss:
                e.LiveAction(screen, p, current_time)
            else:
                e.LiveAction(screen, p, current_time, bomb_map)

        collectItem(p)

        if pressed_Key[K_1]:
            toolbar.use(p, 0)
        if pressed_Key[K_2]:
            toolbar.use(p, 1)
        if pressed_Key[K_3]:
            toolbar.use(p, 2)