新喵報到
pygame吧
全部回复
仅看楼主
level 6
喵喵陳 楼主
import pygame
import random
pygame.init()
disp=pygame.display.Info()
ww=disp.current_w
wh=disp.current_h
win=ww,wh
screen = pygame.display.set_mode(win)
clock = pygame.time.Clock()
ti=0
dx=0
dy=0
dr=0
dg=0
db=0
gx=1
gy=1
def mew(x=0,y=0,r=0,g=0,b=0):
pygame.draw.arc(screen,(r,g,b),(x,y+15,10,10),0,6 )
pygame.draw.line(screen,(r,g,b),(x+5,y+15),(x+5,y+25))
pygame.draw.line(screen,(r,g,b),(x,y+20),(x+10,y+20))
pygame.draw.line(screen,(r,g,b),(x+15,y+5),(x
+3
5,y+5))
pygame.draw.line(screen,(r,g,b),(x+20,y),(x+20,y+10))
pygame.draw.line(screen,(r,g,b),(x+30,y),(x+30,y+10))
pygame.draw.arc(screen,(r,g,b),(x+10,y+10,30,30),0,6 )
pygame.draw.line(screen,(r,g,b),(x+10,y+25),(x+35,y+25))
pygame.draw.line(screen,(r,g,b),(x+25,y+10),(x+25,y+35))
running = True
while running:
mouse=pygame.mouse.get_pos()
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if(mouse[0]>ww-20)&(mouse[1]<20):
running = False
bg=255,255,255
screen.fill(bg)
mew(dx,dy,dr,dg,db)
dx+=gx*5*random.random()
dy+=gy*5*random.random()
if(dx<0)|(dx>ww-40):
gx*=-1
if(dy<0)|(dy>wh-40):
gy*=-1
dr=256*random.random()
dg=256*random.random()
db=256*random.random()
pygame.display.flip()
clock.tick(60)
2024年01月04日 00点01分 1
level 6
喵喵陳 楼主
2024年01月04日 00点01分 2
格式被度受吃了...就補個py檔好了...
2024年01月04日 00点01分
level 6
喵喵陳 楼主
隨手寫寫...
链接: [有效] https://pan.baidu.com/s/13Mwp9EKLU3DxzURuGZnVHw?pwd=khqx 提取码: khqx 复制这段内容后打开百度
2024年01月04日 08点01分 3
1