Skip to content

Instantly share code, notes, and snippets.

@mudream4869
Created May 26, 2014 09:57
Show Gist options
  • Save mudream4869/0406a42637c25b31642c to your computer and use it in GitHub Desktop.
Save mudream4869/0406a42637c25b31642c to your computer and use it in GitHub Desktop.
hello pygame!
import pygame
from pygame.locals import *
def main():
pygame.init()
pygame.font.init()
screen = pygame.display.set_mode((600, 600), 0, 32)
pygame.display.set_caption("Hello world")
mmfont = pygame.font.SysFont('helvetica', 16)
img = mmfont.render("Hello pygame", 1, (0, 0, 0))
while(True):
for event in pygame.event.get():
if event.type == QUIT:
exit()
screen.fill((255,255,255))
screen.blit(img, (10,10))
pygame.display.update()
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment