June 2015
Beginner
348 pages
8h 44m
English
It's important to notice the so-called main game loop, where all the action happens, and the usage of the Font module to render text. In this program, we will manipulate a Pygame Surface object that is used for drawing, and we will handle a quit event.
import pygame, sys from pygame.locals import *
400 by 300 pixels, and set the window title to Hello world!:pygame.init()
screen = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Hello World!')Read now
Unlock full access