Created
May 26, 2014 09:57
-
-
Save mudream4869/0406a42637c25b31642c to your computer and use it in GitHub Desktop.
hello pygame!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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