python慢画炫彩圆圈_pygame绘画与动画
生活随笔
收集整理的這篇文章主要介紹了
python慢画炫彩圆圈_pygame绘画与动画
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
python慢畫炫彩圓圈_pygame繪畫與動畫
import pygame from pygame.locals import * import math import colorsyspygame.init() screenWidth,screenHeight=480,360 screenCenterx,screenCentery = screenWidth//2 -1 ,screenHeight//2 - 1 screen = pygame.display.set_mode((screenWidth,screenHeight)) pygame.display.set_caption("python慢畫炫彩圓圈_pygame_作者:李興球")class Pen():def __init__(self,radius,color,thickness):self.color = color #筆顏色self.thickness = thickness #筆跡寬度self.x = screenCenterx + radiusself.y = screenCenteryself.angle = 0self.radius =radiusdef move(self):self.x = int(screenCenterx + self.radius * math.cos(math.radians(self.angle)))self.y = int(screenCentery + self.radius * math.sin(math.radians(self.angle)))pygame.draw.circle(screen,self.color,(self.x,self.y),20, 0) #畫圓點self.總結
以上是生活随笔為你收集整理的python慢画炫彩圆圈_pygame绘画与动画的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 书摘---创业36条军规4:如何组建公司
- 下一篇: c语言 发纸牌 实验报告,“21点”纸牌