Python如何使用Pygame画一个圆

前几天坐飞机大战,忽然发现没有游戏开始界面???网上也搜不到…没办法,自己做了一个:D

pygame.draw.circle()

首先说一下这个方法的用法:

pygame.draw.circle(screen,color,position,radius,width)

screen:画布
color:指定的颜色(可以是pygame常量也可以是RGB)
position:位置
radius:直径
width:线条宽度(如果想要画实心圆就把它设为radius)

这是我的代码:

color = 255,255,255
position = 233,340
radius = 100
width = 100
pygame.draw.circle(screen,color,position,radius,width)
screen.blit(font1.render("全 民",True,(0,0,0)),(180,290))
screen.blit(font1.render("飞机大战",True,(0,0,0)),(150,350))
screen.blit(font.render("点击屏幕开始游戏",True,(0,0,0)),(130,450))

nice!
nice!

猜你喜欢

转载自blog.csdn.net/weixin_39441881/article/details/106965386