[Python] why is my game opening and then closing immediately? [closed]

Discussão em 'Python' iniciado por Stack, Junho 22, 2025.

  1. Stack

    Stack Membro Participativo

    these is what happens when i run my code these are the errors when i try to use pgzrun instead of pygame

    i started by downloading the python, pygame, and pygame zero stuff, i then inserted my code, and after running it, it says it doesn't recognize the stuff that's supposed to take from the packages? if i use pgzrun it tells me the errors (the ones in the image) but if i just run it with pygame, it doesn't even tell me what's wrong in the terminal.

    only the beginning of the code is what i think is giving me problems

    import pygame
    pygame.init()
    pygame.display.set_mode((600, 300))
    from pgzero.builtins import Actor, keys, keyboard, mouse
    from pgzero.actor import Actor
    from pgzero import screen
    from pygame import Rect
    import random

    Continue reading...

Compartilhe esta Página