Ejemplo n.º 1
0
        if event.type == pygame.KEYUP:
            if event.key == pygame.K_LEFT or event.key == ord('a'):
                if mx == -1:
                    mx = 0
            if event.key == pygame.K_RIGHT or event.key == ord('d'):
                if mx == 1:
                    mx = 0
            if event.key == pygame.K_UP or event.key == ord('w'):
                if my == -1:
                    my = 0
            if event.key == pygame.K_DOWN or event.key == ord('s'):
                if my == 1:
                    my = 0

    plane.check_all_hit(hm.huajilist)
    plane.check_crash(hm.huajilist)

    if plane.lives <= 0:
        break

    hm.generate()
    hm.update()
    hm.draw()

    plane.move(mx * MOVESTEP, my * MOVESTEP)
    plane.draw()

    plane.fire()
    plane.update_bullets()
    plane.draw_bullets()