Chapter 5: Introduction to Graphics
教程:http://programarcadegames.com/index.php?chapter=introduction_to_graphics&lang=zh#section_5
选色网站:
http://www.colorpicker.com/
pygame.draw
http://www.pygame.org/docs/ref/draw.html
import pygame
#define color
white = (255,255,255)
black = (0,0,0)
red = (255,0,0)
green = (0,255,0)
blue = (0,0,255)
yellow = (255,255,50)
pi = 3.141592653
pygame.init()
size = [700,500]
screen = pygame.display.set_mode(size)
pygame.display.set_caption('songjiao')
done = False
clock = pygame.time.Clock()
while done == False:
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
screen.fill(white)
pygame.draw.line(screen,blue,[5,5],[105,5],3)
pygame.draw.line(screen,blue,[355,5],[500,5],3