xxxxxxxxxx
#bringing pygame into python as a module
import pygame
#allowing pygame to work its magic
pygame.init()
#this sets the size of the screen you want
screen = pygame.display.set_mode((800, 800))
#this is a while loop that allows you to close the window when the x is pressed
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
xxxxxxxxxx
import pygame
background_colour = (255,255,255)
(width, height) = (300, 200)
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption('Tutorial 1')
screen.fill(background_colour)
pygame.display.flip()
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
xxxxxxxxxx
# This is the most easiest method to create a screen in pycharm
import pygame
# initialize pygame
pygame.init()
screen = pygame.display.set_mode((1370, 710))
#1370,710 gives a full screen
xxxxxxxxxx
import pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
clock = pygame.time.Clock()
while True:
screen.fill((192, 192, 192))
pygame.display.update()
clock.tick(60)
xxxxxxxxxx
so here i will be giving the most basic and most easy method
import pygame
# initialize pygame
pygame.init()
screen = pygame.display.set_mode((1370, 710))
#1370,710 gives a full screen
xxxxxxxxxx
import pygame
background_colour = (255,255,255)
(width, height) = (700, 500)
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption('Tutorial 1')
screen.fill(background_colour)
pygame.display.flip()
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False