美国AP Computer Science辅导

# ————————————————————-

# Author:

# Summary:

#

# ————————————————————-

import pygame, sys  # Add sys to include ability to exit a window

from pygame.locals import *  # Import specific variazbles

import random

# — GLOBAL VARIABLES —

hSize, vSize = 1024, 768  # Variables for screen size

# Define some colors

WHITE = (255, 255, 255)

BLACK = (0, 0, 0)

RED = (255, 0, 0)

GREEN = (0, 255, 0)

BLUE = (0, 0, 255)

pygame.init()  # Tell pygame to initialize our environment

pygame.display.set_caption(“Car Game”)

window = pygame.display.set_mode((hSize, vSize), 0, 24)

Speed = 20

Frequency = 10

# — END GLOBAL VARIABLES —

class Player(pygame.sprite.Sprite):