Answers for "pygame draw tutorial"

2

how to create a window in pygame

import pygame
pygame.init() #initialize pygame
SCREEN_WIDTH = 600 # width (in px)
SCREEN_HEIGHT = 800 # height (in px)

WIN = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) # creates a screen of 600px X 800px

while True:
	pygame.display.update() # updates the screen
Posted by: Guest on July-02-2020
1

pygame how to draw a rectangle

pygame.draw.rect(DISPLAY,BLUE,(200,150,100,50))
Posted by: Guest on September-04-2020
-1

pygame tutorial

clock = pygame.time.Clock()
Posted by: Guest on October-09-2020

Python Answers by Framework

Browse Popular Code Answers by Language