照python游戏入门的第二章的内容敲了下Pie这个小游戏。了解了用pygame 编程时的一些基本结构。
源代码如下:
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 13 20:41:41 2015
@author: liuchang
"""
import math
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((600,500))
pygame.display.set_caption("pie game")
myfont = pygame.font.Font(None,60)
color = 200,80,60
width =4
x=300