0

Basically I wrote this simple script to just open a pygame window and just close it when pg.Quit (256) event occurs but it wont work. When I manually check event.type it always returns 32776 which im not event able to find in the pg.event.get() list. I have event tried inserting pg.Quit as 256 it didnt work

import pygame as pg

import sys

pg.init()

def q():
    pg.quit()
    sys.exit()

black = (0, 0, 0)
white = (255, 255, 255)
red = (255, 0, 0)
green = (0, 255, 0)
blue = (0, 0, 255)

FPS = 60


screen = pg.display.set_mode((800,800))
clock = pg.time.Clock()

rect = pg.Rect((0, 0), (32, 32))
image = pg.Surface((32, 32))
image.fill(white)
clock.tick(FPS)

for event in pg.event.get():
#when I mannualy check event.type it only returns 32776
#I v even tried using 256 instead of pg.Quit()
        if event.type == pg.Quit():
                q()
PANKRAV
  • 1
  • 1
  • 1

0 Answers0