Answers for "pygame python3"

1

install pygame on mac

python3 -m pip install -U pygame==2.0.0.dev6
Posted by: Guest on September-28-2020
26

python pygame

# Be sure to install pygame via pip

import pygame
import sys

# initialize it
pygame.init()

# configurations
frames_per_second = 30
window_height = 600
window_width = 400

# colors
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
BLUE = (0, 0, 255)

# creating window
display = pygame.display.set_mode((window_width, window_height))

# creating our frame regulator
clock = pygame.time.Clock()

# forever loop
while True:
  # frame clock ticking
  clock.tick(frames_per_second)
  
  # frame Drawing
  display.fill(WHITE)
  
  # event loop
  for event in pygame.event.get():
    if event.type == pygame.QUIT:
      pygame.quit()
      sys.exit()
Posted by: Guest on September-19-2020
0

pygame python3.8

python3 -m pip install pygame==2.0.0.dev10
Posted by: Guest on July-01-2020
0

how to set up pygame

import pygame
import os
import sys
import random
pygame.init()
screen = pygame.display.set_mode((800, 500))
Posted by: Guest on October-31-2020

Python Answers by Framework

Browse Popular Code Answers by Language