запускается и с разу же закрывается exe pyton

я незнаю в чем проблема но вот мой код

import play
import pygame
circllo = play.new_image(image= "WhatsApp.jpeg",x = 0, y = -5,size= 80 )
platform = play.new_image(image= "1.jpg",x = 0, y = -250,size= 80 )
circle = play.new_image(image= "images (2).jpg",x = 0, y = -250,size= 50 )
circ = play.new_image(image= "images (1).jpg",x = 0, y = -250,size= 50 )
cir = play.new_image(image= "images.jpg",x = 0, y = -250,size= 50 )
ci = play.new_image(image= "2.jpg",x = 0, y = -250,size= 50 )
#new_circle 
#x, y, radius, color
blocks = []
#-----    
@play.when_program_starts
def start():
  platform.start_physics(stable = True, obeys_gravity = False, bounciness = 1, mass=1)
  circle.start_physics(stable = False,x_speed=35, y_speed = 35, obeys_gravity = False, bounciness = 1, mass=10)
  ci.start_physics(stable = False,x_speed=35, y_speed = 35, obeys_gravity = False, bounciness = 1, mass=10)
  cir.start_physics(stable = False,x_speed=35, y_speed = 35, obeys_gravity = False, bounciness = 1, mass=10)
  circ.start_physics(stable = False,x_speed=35, y_speed = 35, obeys_gravity = False, bounciness = 1, mass=10)
  block_x = play.screen.left+75
  block_y = play.screen.top-50

  for i in range(3):
    while (block_x <= play.screen.right -30):
      block = play.new_box(color = 'red', x = block_x, y = block_y, width = 110, height = 30, border_color = "white", border_width = 1)

      blocks.append(block)
      block_x=block_x + block.width

    block_x = play.screen.left+75
    block_y = block.y - block.height

@play.repeat_forever
def do():
  if play.key_is_pressed('d'):
    platform.physics.x_speed = 30
  elif play.key_is_pressed('a'):
    platform.physics.x_speed = -30
  elif play.key_is_pressed('w'):
    platform.physics.y_speed = 30
  elif play.key_is_pressed('s'):
    platform.physics.y_speed =-30
  else:
    platform.physics.y_speed = 0

  for b in blocks:
        if b.is_touching(circle):
            circle.physics.x_speed = -1 * circle.physics.x_speed
            circle.physics.y_speed = -1 * circle.physics.y_speed
            b.hide()
            blocks.remove(b)
  for b in blocks:
        if b.is_touching(ci):
            ci.physics.x_speed = -1 * ci.physics.x_speed
            ci.physics.y_speed = -1 * ci.physics.y_speed
            b.hide()
            blocks.remove(b)
  for b in blocks:
        if b.is_touching(circ):
            circ.physics.x_speed = -1 * circ.physics.x_speed
            circ.physics.y_speed = -1 * circ.physics.y_speed
            b.hide()
            blocks.remove(b)
  for b in blocks:
        if b.is_touching(cir):
            cir.physics.x_speed = -1 * cir.physics.x_speed
            cir.physics.y_speed = -1 * cir.physics.y_speed
            b.hide()
            blocks.remove(b)
  for b in blocks:
        if b.is_touching(platform):
            platform.physics.x_speed = -1 * platform.physics.x_speed
            platform.physics.y_speed = -1 * platform.physics.y_speed
            b.hide()
            blocks.remove(b)
play.start_program()

либо я неправельно скомпелиревал


Ответы (1 шт):

Автор решения: Илья Кречетов

Из-за изменений в модуле pymunk, pymunk.inf больше не работает.

Вместо него нужно использовать float("inf"). Замените в файле play.py в 779 строке:

moment = _pymunk.inf 

на:

moment = float("inf")`
→ Ссылка