Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created November 15, 2015 18:47
Show Gist options
  • Save AndyNovo/38c012760a5a960a9548 to your computer and use it in GitHub Desktop.
Save AndyNovo/38c012760a5a960a9548 to your computer and use it in GitHub Desktop.
import pygame
BLACK = (0,0,0)
RED = (255, 0, 0)
screen = pygame.display.set_mode([450, 600])
another_loop = True
clock = pygame.time.Clock()
while another_loop:
# --- Basic Event Processing
for event in pygame.event.get():
if event.type == pygame.QUIT:
another_loop = False
# Every loop we will wipe the screen and redraw images
screen.fill(BLACK)
#Draw the new screen here:
pygame.draw.circle(screen, RED, (50, 50), 30)
#This sets the frames per second
clock.tick(60)
#This puts the new stuff you've drawn on screen
pygame.display.flip()
#When we've left the while loop exit pygame
pygame.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment