矩形对象的点与矩形碰撞原理演示程序

"""
   矩形对象的点与矩形碰撞原理演示程序.py
"""
import pygame
from pygame.locals import *

WIDTH,HEIGHT = 480,360
screen = pygame.display.set_mode((WIDTH,HEIGHT))

r = pygame.Rect(0,0,100,100)
r.center = (WIDTH//2,HEIGHT//2)

running = True
while running :
    event = pygame.event.poll()  # 从事件队列中取一个事件
    if event.type == QUIT:running = False

    x,y = pygame.mouse.get_pos()

You must log in to read the rest of this article. Please log in or register as a user.