pygame package code example
Example 1: pygame install
pip install pygame
Example 2: pip install pygame
py -m pip install -U pygame --user
Example 3: pygame setup
import pygame
pygame.init()
win = pygame.display.set_mode((500,500))
pygame.display.set_caption("First Game")
x = 50
y = 50
width = 40
height = 60
vel = 5
run = True
while run:
pygame.time.delay(100)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit()
Example 4: pygame download
py -m pip install -U pygame --user