Exemple #1
0
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_SPACE:
                #shoot()
                level.decrease_health(100)
            if event.key == pygame.K_ESCAPE:
                running = False
        if event.type == pygame.MOUSEBUTTONDOWN:
            array = pygame.mouse.get_pressed()
            if array[0]:
                shoot()
            if array[1]:
                cursor.calibrate()
            if array[2]:
                pygame.quit()


    cursor.update()

    """ Clear and background """
    screen.fill((255, 255, 255))
    screen.blit(background, (0, 0))

    if GameStateEnum.mainmenu == gamestate.getState():
        """ Update """

        """ Draw """
        popup.draw(screen)