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
没有评论:
发表评论