how to create a window in pygame

import pygame
pygame.init()
back = (192,192,192)
gameDisplay = pygame.display.set_mode((800,600))
pygame.display.set_caption('A bit Racey')
gameDisplay.fill(back)
clock = pygame.time.Clock()
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    pygame.display.update()
    clock.tick(60)   
pygame.quit()
quit()
            

0
0

                                    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

0
0
4
1
Jmbpiano 120 points

                                    import pygame
pygame.init()
screen = pygame.display.set_mode((800,600))
pygame.display.set_caption('A bit Racey')
clock = pygame.time.Clock()
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    pygame.display.update()
    clock.tick(80)   
pygame.quit()
quit()

4 (1 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
pygame how to make a window how to open window in pygame how to initialize a pygame window pygame basic window pygame window tutorial pygame window example set up a pygame window pygame simple window code pygame simple window python pygame window creating a window in pygame create window in python pygame how to create pygame window how to set up a window in python with pygame window pygame pygame make windowed simple pygame window new window pygame make pygame window python how to make a pygame window fo game how to setup a window in pygame make a pygame window how to open a window in pygame how to make pygame window how to get a window in pygame how to initialize pygame window how to draw a window in pygame making game window in pygame pygame example how to create a pygame window create a windows pygame pygame make a window create a pygame window setup pygame window make a window pygame create window pygame how to make a window in pygame make pygame window how to make window pygame how to make a window pygame pygame set up screen window in pygame pygame game window pygame display code how to make a window using pygame pygame how to create a window pygame make window create a game with python pygame create pygame window how to create a window with pygame how to create the pygame window create a window pygame pygame window how to make how to create a window in python pygame how to make a window in python pygame a window in python pygame pygame create window how to keep a pygame window open pygame window how to create window loop pygame make a window in pygame how to make a window with pygame how to make a windows with pygame how to keep pygame.display running how can we make the pygame window stay pygame screen setup open pygame window pygame draw window pygame window open screen pygame pygame window in python 3 how to create a window in pygame
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source