BigSteve/PyGame/practice/pygametemplate.py

36 lines
621 B
Python

import pygame
import random
import os
WIDTH = 360
HEIGHT = 480
WINDOW_SIZE = (WIDTH, HEIGHT)
FPS = 30
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
pygame.init()
pygame.mixer.init()
screen = pygame.display.set_mode(WINDOW_SIZE)
pygame.display.set_caption("My Game")
clock = pygame.time.Clock()
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
running = True
while running:
clock.tick(FPS)
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.fill(BLACK)
pygame.display.flip()
pygame.quit()