本文实例讲述了Python基于pygame实现的弹力球效果。分享给大家供大家参考,具体如下:
运行效果:
代码部分如下:
#A bouncing ball
import sys, pygame
__author__ = {'name' : 'Hongten',
'mail' : '[email protected]',
'QQ' : '648719819',
'Version' : '1.0'}
pygame.init()
size = width, height = 600, 500
speed = [1, 1]
black =