理解帧率
FPS(Frame Per Second),一般电视画面是24FPS,30FPS基本可提供流畅的体验,60FPS是LCD常用的刷新率;而绝大多数人无法分辨70FPS以上的画面。
直线运动
尝试让hello world程序中的鱼动起来:
background_filename = 'sushiplate.jpg'
mouse_filename = 'fugu.png'
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((640,480),RESIZABLE,32)
mouse_cursor = pygame.display.set_caption('hello world!')
background = pygame.image.load(background_filename).convert()
mouse_cursor = pygame.image.load(mouse_filename).convert_alpha()
x == 0