2013年8月21日星期三

As strong as a crusher,python game tutorial(1)

After install python and pygame, we can try out the hello world program:

hello-crusher.py:

# hello world

# as install python and pygame, let us try hello wrold game


import pygame, sys
from pygame.locals import *

# init pygame engin
pygame.init()

# get something like a window
DISPLAYSURF = pygame.display.set_mode((400,640))

pygame.display.set_caption('hello mobile crusher')

# endless loop to see if any event to quit the all things
while True:
    for event in pygame.event.get():
        if event.type == QUIT:  # if it is quit function
            pygame.quit()
            sys.exit()
    pygame.display.update()     # update all things


now, we get the helloo world of pygame!

http://www.quarryequipments.com for more

没有评论:

发表评论