Skip to content

Instantly share code, notes, and snippets.

@mgalgs
Created July 20, 2016 21:38
Show Gist options
  • Save mgalgs/588834aa3be3f4e4525a822cf703b53b to your computer and use it in GitHub Desktop.
Save mgalgs/588834aa3be3f4e4525a822cf703b53b to your computer and use it in GitHub Desktop.
pygame demo
import pygame as pg
pg.init()
width = 500
height = 500
screen = pg.display.set_mode((width, height))
# (x, y) coordinates. We'll put it right in the middle.
x = width / 2
y = height / 2
for radius in range(100, 0, -1):
red = 255
green = radius * 2 # just to make the color change
blue = 0
pg.draw.circle(screen, (red, green, blue), (x, y), radius)
# this makes the screen actually update:
pg.display.flip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment