Skip to content

Instantly share code, notes, and snippets.

@joonazan
Created September 15, 2016 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joonazan/ffa9a69092e157830fffda7f633a5afd to your computer and use it in GitHub Desktop.
Save joonazan/ffa9a69092e157830fffda7f633a5afd to your computer and use it in GitHub Desktop.
import pygame
def main():
pygame.init()
window = pygame.display.set_mode((500, 500))
clock = pygame.time.Clock()
y = 100
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
return
y += 1
window.fill(pygame.color.Color(0, 0, 0))
pygame.draw.rect(window, pygame.color.Color(255, 0, 0), pygame.Rect(100, y, 20, 20))
pygame.display.flip()
clock.tick(60)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment