python海龟画图足球怎么画

Python014

python海龟画图足球怎么画,第1张

python海龟画图足球怎么画:

1:打开软件python

2:编辑所需要的信息

3:然后编辑好了之后确认,点击右上角的设置中心

4:在设置中心里面找到信息就可以了

首回合:波黑主场——Bilino Polje球场(泽尼察)

次回合:比利时主场——帝王球场(布鲁塞尔)

2016欧洲杯预选赛B组小组赛,双方的首回合比赛在北京时间2014年10月14日02:45进行,波黑在主场以1:1战平比利时。

双方的次回合比赛将于北京时间2015年09月04日02:45在比利时的主场举行。

目前在B组积分榜上,比利时5战3胜2平积11分,位居小组第一,波黑以1胜2平2负积5分暂居小组第五。

这个很简单,首先要安装,命令如下:pip install pygame

然后使用,代码如下:

import pygame

import sys

#初始化

pygame.init()

size=width,height=1000,800

speed=[-5,3]

bg=(0,0,0)

#创建窗口大小

screen=pygame.display.set_mode(size)

#窗口标题

pygame.display.set_caption("跳动的足球")

#图片

a=pygame.image.load("111.png")

#获得图像的位置矩形

position =a.get_rect()

while True :

for event in pygame.event.get():

if event.type ==pygame.QUIT:

sys.exit()

#移动图像

position=position.move(speed)

if position.left<0 or position.right>width:

#翻转

a=pygame.transform.flip(a,True,False)

#反向移动

speed[0]=-speed[0]

if position.top<0 or position.bottom>height:

speed[1]=-speed[1]

screen.fill(bg)

screen.blit(a,position)

pygame.display.flip()

pygame.time.delay(10)